79368404

Date: 2025-01-19 04:25:02
Score: 0.5
Natty:
Report link

Yes, i'm use GetIt to this. example?

GetIt getIt = GetIt.instance;

void setupLocator() {
  getIt.registerLazySingleton<MyGoRouterDelegate>(() => MyGoRouterDelegate());
} //call setupLocator first in void main(){..}

And can use with

 routerConfig: getIt<MyGoRouterDelegate>().router,

And navigate without context with this

getIt<MyGoRouterDelegate>()
          .router
          .pushNamed(AppRoutes.productName, pathParameters: {'id': productModel.id.toString()}),
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: murakami KauĂȘ