jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.34k stars 1.62k forks source link

Could not find a generator for route RouteSettings("/social/users/1/post", 1) in the _WidgetsAppState in flutter #2572

Open Sunsiha opened 2 years ago

Sunsiha commented 2 years ago

I wanted to show routing url in flutter web. So for that am using Getx the following way,

 class AppRoutes {
      static const users = '/social/users/';
}

main.dart

 routes: <String, WidgetBuilder>{
            AppRoutes.users: (BuildContext context) =>
            const ViewCandidatesScreen(),
          }

Redirecting to another screen;

String id='1';
Get.toNamed(AppRoutes.users+id+"/post",arguments:'1');

If I do like this it's throwing an error like the following;

Could not find a generator for route RouteSettings("/social/users/1/post", 1) in the _WidgetsAppState in flutter

chiptus commented 8 months ago

@Sunsiha you need to defined also /social/users/:id/post route