-
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
base: main
Are you sure you want to change the base?
Update app.dart #2359
Conversation
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.
Code Review
This pull request updates app.dart by removing the PlayPauseListener from the MaterialApp.router builder. My primary concern is the removal of the PlayPauseListener, which could unintentionally remove global playback control functionality from the app. I've also pointed out some unnecessary and misleading comments that should be removed to improve code clarity and maintainability.
| routeInformationParser: appRouter.routeInformationParser, | ||
| routeInformationProvider: appRouter.routeInformationProvider, | ||
| routerDelegate: appRouter.routerDelegate, | ||
| builder: (context, child) { | ||
| return PlayPauseListener(child: child!); | ||
| }, |
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.
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.
| // ✅ 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 |
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 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.
| // ✅ 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
|
I'm curious what you are attempting to accomplish here. |
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. For larger changes, raising an issue first helps
reduce redundant work.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-devrel channel on Discord.