We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I am trying to build the app with custom theme using ValueBuilder and AppStateProvider.
ValueBuilder
AppStateProvider
Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.6 18G103, locale en-VN) • Flutter version 1.12.13+hotfix.5 at /Users/thanhla/flutter • Framework revision 27321ebbad (6 weeks ago), 2019-12-10 18:15:01 -0800 • Engine revision 2994f7e1e6 • Dart version 2.7.0
But my app appear black screen before opening the first screen.
final theme = AppStateProvider.of<AppState>(context).currentTheme; return ValueBuilder<MyTheme>( streamed: theme, builder: (context, snapshot) => MaterialApp( title: 'Flutter Demo', theme: _buildThemeData(snapshot.data), onGenerateRoute: generateRoute, debugShowCheckedModeBanner: false, navigatorKey: navigatorKey, initialRoute: Routes.home, ), );
Please check my demo code, thank you! quiz.zip
The text was updated successfully, but these errors were encountered:
maybe I am missing initialData
initialData
final theme = AppStateProvider.of<AppState>(context).currentTheme; return ValueBuilder<MyTheme>( streamed: theme, initialData: AppTheme.defaultLight, // add this line builder: (context, snapshot) => MaterialApp( title: 'Flutter Demo', theme: _buildThemeData(snapshot.data), onGenerateRoute: generateRoute, debugShowCheckedModeBanner: false, navigatorKey: navigatorKey, initialRoute: Routes.home, ), );
Sorry, something went wrong.
No branches or pull requests
Hello,
I am trying to build the app with custom theme using
ValueBuilder
andAppStateProvider
.But my app appear black screen before opening the first screen.
Please check my demo code, thank you!
quiz.zip
The text was updated successfully, but these errors were encountered: