I upgraded to flutter 2.10 for a new projet, I setup my project like i usually do (injectable, getIt... ect). what I'm facing right now, is whenever I do a hot reload (ctrl+s), the whole application rebuilds but it displays normally for a fraction of a second then it displays a blank screen. like so:
also when looking at the inspector after the unexpected blank screen I only find:
knowing that normally it displays the widget's tree (login screen...).
the main function:
void main() async {
setupLogging();
setPathUrlStrategy();
final LocalizationDelegate delegate = await createDelegate();
BlocOverrides.runZoned(
() => runApp(LocalizedApp(delegate, Application())),
blocObserver: ApplicationObserver(),
);
}
the Application Class:
class Application extends StatelessWidget {
Application({Key? key}) : super(key: key);
final initializer = initialize();
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: initializer,
builder: (context, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.none:
case ConnectionState.waiting:
case ConnectionState.active:
return Container(
child: const Center(
child: CircularProgressIndicator(),
),
);
case ConnectionState.done:
log("**************************** or here");
final delegate = getDelegate(context);
final AppRouter router = AppRouter(authGuard: getIt<AuthGuard>());
return LocalizationProvider(
state: LocalizationProvider.of(context).state,
child: MaterialApp.router(
routeInformationParser: router.defaultRouteParser(),
routerDelegate: router.delegate(),
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
delegate,
],
supportedLocales: delegate.supportedLocales,
locale: delegate.currentLocale,
theme: ApplicationTheme.lightTheme,
// darkTheme: ApplicationTheme.darkTheme , todo
),
);
}
});
}
static Future initialize() async {
await configureDependencies();
}
}
the logs after hot reload display:
[log] **************************** or here // at the application state done
[log] ****************************** inside the login? // at the login screen build
[log] **************************** or here // back at the application state done, but no
login screen after this...
What may be the cause of thise issue? any hints please?

