Milad-Akarie / auto_route_library

Flutter route generator
MIT License
1.59k stars 405 forks source link

How to pass arguments in auto_route pushNamed method #1861

Open rnp0728 opened 8 months ago

rnp0728 commented 8 months ago

Using push ElevatedButton( onPressed: () { context.router.push(AboutRoute(id: 'id', gender: "Male"),); }, child: const Text("About"), ),

How can I pass thode params using pushNamed ElevatedButton( onPressed: () { context.router.pushNamed(RouteNames.aboutRoute); }, child: const Text("About"), ), In go route we have options like pathParameters & queryParamaters

        GoRouter.of(context).pushNamed(
          context.read<ProvidersListCubit>().state.submoduleData?[0]['url'] ??
              '',
          queryParameters: {
            'businessId': encrypt(text: businessId ?? '', context: context),
            'moduleId': context
                .read<ProvidersListCubit>()
                .state
                .submoduleData?[0]['moduleId'],
            'bName': name,
          },
        ).then(onGoBack);

In auto_route these is no such stuff, if there is anything please help me out!.

rnp0728 commented 8 months ago

In Autoroute when we use popUntil why it isn't clearing the browser stack?

Shahad-999 commented 1 month ago

any update??