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
overlayEntry should not be null #84
Comments
Thanks for taking the time to open an issue. I will have a look and answer as soon as possible. |
Initialize EasyLoading in your class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter EasyLoading',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter EasyLoading'),
builder: EasyLoading.init(),
);
}
} |
@kokohuang how can I do that with more advanced @override
Widget build(BuildContext context) {
return MaterialApp.router(
debugShowCheckedModeBanner: false,
key: _navigatorKey,
title: 'Title',
theme: ThemeData(
primarySwatch: Colors.grey,
appBarTheme: AppBarTheme(
color: Colors.white,
),
visualDensity: VisualDensity.adaptivePlatformDensity,
),
builder: (context, child) {
ErrorWidget.builder = (FlutterErrorDetails errorDetails) {
return buildError(context, errorDetails);
};
EasyLoading.init(); // does not work
// ignore: close_sinks
final ApplicationBloc _applicationBloc =
BlocProvider.of<ApplicationBloc>(context);
return Container(
child: BlocProvider(
create: (_) => _applicationBloc,
child: BlocListener<ApplicationBloc, ApplicationState>(
listener: _applicationBlocListener,
child: BlocBuilder<ApplicationBloc, ApplicationState>(
builder: (context, state) {
if (state is InitialApplicationState ||
state is ApplicationLoadingState) {
return LoadingWidget();
} else if (state is ApplicationLoadedState) {
return child;
} else {
return Text("Application load error. Try again.");
}
},
),
),
),
);
},
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: const <Locale>[
const Locale('en', 'US'),
const Locale('pl', 'PL'),
],
routerDelegate: _appRouter.delegate(),
routeInformationParser: _appRouter.defaultRouteParser(),
);
} |
EasyLoading.init()
|
I was got this errer Please help me ASAP 'package:flutter_easyloading/src/easy_loading.dart': Failed assertion: line 298 pos 7: '_getInstance().overlayEntry != null': overlayEntry should not be null This is my Flutter Doctor details Doctor summary (to see all details, run flutter doctor -v): |
@kyadakrupali08 you shuld init EasyLoading in you MaterialApp class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter EasyLoading',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter EasyLoading'),
builder: EasyLoading.init(),
);
}
} |
Describe the bug
I receive an error from flutter
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: 'package:flutter_easyloading/src/easy_loading.dart': Failed assertion: line 428 pos 7: 'overlayEntry != null': overlayEntry should not be null
Flutter/Dart info
please run
flutter doctor
then put it here.Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: