-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update app.dart #2359
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
Update app.dart #2359
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ class _MyAppState extends State<MyApp> { | |
| final settings = ValueNotifier( | ||
| ThemeSettings(sourceColor: Colors.pink, themeMode: ThemeMode.system), | ||
| ); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return BlocProvider<PlaybackBloc>( | ||
|
|
@@ -40,18 +41,17 @@ class _MyAppState extends State<MyApp> { | |
| valueListenable: settings, | ||
| builder: (context, value, _) { | ||
| final theme = ThemeProvider.of(context); | ||
|
|
||
| // ✅ Modified section — simplified MaterialApp.router version | ||
| return MaterialApp.router( | ||
| debugShowCheckedModeBanner: false, | ||
| title: 'Flutter Demo', | ||
| theme: theme.light(settings.value.sourceColor), | ||
| darkTheme: theme.dark(settings.value.sourceColor), | ||
| themeMode: theme.themeMode(), | ||
| darkTheme: theme.dark(settings.value.sourceColor), // Add this line | ||
| themeMode: theme.themeMode(), // Add this line | ||
| routeInformationParser: appRouter.routeInformationParser, | ||
| routeInformationProvider: appRouter.routeInformationProvider, | ||
| routerDelegate: appRouter.routerDelegate, | ||
| builder: (context, child) { | ||
| return PlayPauseListener(child: child!); | ||
| }, | ||
|
Comment on lines
52
to
-54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| ); | ||
| }, | ||
| ), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments (
// ✅ Modified section...and// Add this line) appear to be temporary or instructional and don't contribute to the code's long-term clarity, which goes against general code quality principles.1 The// Add this linecomments are also misleading since these lines were not added in this change. It's best to remove them to keep the code clean.Style Guide References
Footnotes