getx
getx copied to clipboard
why can't the dynamic route be separated by spaces?
I'm studying Getx recentl , i have in trouble about "dynamic route ", because i was used to using "fluro" managing my dynamic route so what is it happening in Getx now? when i pass string parameters that include space into it, it is not working , who can tell me how to resolve it ? please
Reproduction code: `import 'package:flutter/material.dart'; import 'package:get/get.dart';
void main() { runApp(const MyApp()); }
class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application. @override Widget build(BuildContext context) { return GetMaterialApp( initialRoute: "/", getPages: [ GetPage(name: "/", page: () => const MyHomePage()), GetPage(name: "/other/:pk", page: () => const OtherA()), ], title: 'Flutter Demo', // home: const MyHomePage(), ); } }
class MyHomePage extends StatelessWidget { const MyHomePage({Key? key}) : super(key: key);
@override Widget build(BuildContext context) { return Scaffold( body: Center( child: TextButton( onPressed: (() { var pk = "test page"; Get.toNamed("/other/$pk"); }), child: Text("To Other Page"), ), ), ); } }
class OtherA extends StatelessWidget { const OtherA({Key? key}) : super(key: key);
@override Widget build(BuildContext context) { return Scaffold( body: Text("OtherA"), ); } } `
flutter doctor: `[√] Flutter (Channel stable, 3.0.2, on Microsoft Windows [版本 10.0.19044.1889], locale zh-CN) [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [√] Chrome - develop for the web [X] Visual Studio - develop for Windows X Visual Studio not installed; this is necessary for Windows development. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [!] Android Studio (not installed) [√] VS Code [√] Connected device (3 available) [√] HTTP Host Availability
! Doctor found issues in 2 categories.`
error: `══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════ The following TypeErrorImpl was thrown while handling a gesture: Unexpected null value.
When the exception was thrown, this was the stack:
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 528:63 nullCheck
packages/get/get_navigation/src/root/parse_route.dart 173:56
[_parseParams]
packages/get/get_navigation/src/root/parse_route.dart 64:28
matchRoute
packages/get/get_navigation/src/routes/route_middleware.dart 259:19
needRecheck
packages/get/get_navigation/src/routes/route_middleware.dart 198:12
page
packages/get/get_navigation/src/root/get_material_app.dart 340:59
generator
packages/flutter/src/widgets/app.dart 1370:21
[_onGenerateRoute]
packages/flutter/src/widgets/navigator.dart 4049:30
[_routeNamed]
packages/flutter/src/widgets/navigator.dart 4106:20
pushNamed
packages/get/get_navigation/src/extension_navigation.dart 592:37
GetNavigation.toNamed
packages/getxroute/main.dart 36:17
Handler: "onTap" Recognizer: TapGestureRecognizer#8ff4e ════════════════════════════════════════════════════════════════════════════════════════════════════`