Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions boring_to_beautiful/step_03/lib/src/shared/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand All @@ -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
Comment on lines +45 to +51

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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 line comments are also misleading since these lines were not added in this change. It's best to remove them to keep the code clean.

Suggested change
// ✅ 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
return MaterialApp.router(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: theme.light(settings.value.sourceColor),
darkTheme: theme.dark(settings.value.sourceColor),
themeMode: theme.themeMode(),

Style Guide References

Footnotes

routeInformationParser: appRouter.routeInformationParser,
routeInformationProvider: appRouter.routeInformationProvider,
routerDelegate: appRouter.routerDelegate,
builder: (context, child) {
return PlayPauseListener(child: child!);
},
Comment on lines 52 to -54

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The PlayPauseListener has been removed from the MaterialApp.router's builder. This is a significant functional change that could break global play/pause handling across the app. If this removal is intentional, please explain the reasoning in the pull request description. If it was removed by mistake, it should be restored.

);
},
),
Expand Down