-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loader not init. #50
Comments
It's not recomended to add one LoaderOverlay for each and every page. The best way to use it, is to add one global loader and use it on all the pages. |
If you are using Navigation 2.0 (MaterialApp.router) you can use the builder approach to apply LoaderOverlay to your entire app. MaterialApp.router(
...
builder: (_, Widget? app) => LoaderOverlay(app),
...
); |
@rodrigobastosv @callmephil could you recommend how to do it when using goRouter and config instead of builder? MaterialApp.router(
// code...
routerConfig: goRouter,
// more code...
) |
The method I shared is the best I found for GoRouter and Material.router in general. |
Hello ,
i already worked with this loader.
Some pages display the loader, Same functionality worked not another page.
Given the below message.
LateInitializationError: Field '_overlayController@1721390500' has not been initialized.
All routes pages with set the below code.
RoutesApp.locationScreenPage: (context) => LoaderOverlay(
child: LocationScreenPage(),
useDefaultLoading: false,
overlayWidget: Center(
child: SpinKitCubeGrid(
color: AppColor.app_red,
size: 50.0,
),
),
overlayColor: Colors.black,
overlayOpacity: 0.8,
)
And all pages with show and hide according to below code.
Hide.
context.loaderOverlay.hide();
_isLoaderVisible = context.loaderOverlay.visible;
Show :
context.loaderOverlay.show();
_isLoaderVisible = context.loaderOverlay.visible;
Please give suggestions about late LateInitializationError.
The text was updated successfully, but these errors were encountered: