chore: Remove current dark mode implementation#3007
chore: Remove current dark mode implementation#3007marcnause merged 6 commits intofossasia:flutterfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideForces the app to always use the light theme across platforms by removing dark-mode-specific theming, including Android launch/normal themes, and also adds missing geolocator plugins to the Windows and macOS generated registrant files and CMake plugin list. Sequence diagram for app startup with forced light themesequenceDiagram
actor User
participant AndroidOS
participant FlutterEngine
participant MaterialApp
participant AppTheme
User->>AndroidOS: Launch app
AndroidOS->>AndroidOS: Select LaunchTheme Theme.Light.NoTitleBar
AndroidOS->>FlutterEngine: Start Flutter engine
FlutterEngine->>MaterialApp: Create root widget
MaterialApp->>MaterialApp: Set themeMode light
MaterialApp->>AppTheme: Request lightTheme
AppTheme-->>MaterialApp: Return lightTheme
MaterialApp->>AndroidOS: Render first frame with light UI
User-->>MaterialApp: Sees light-themed interface
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- If dark mode is fully disabled, consider removing the
values-nightvariant (or adding a short comment) since it now duplicates the light theme and may confuse future maintainers about whether dark mode is supported. - The macOS and Windows
GeneratedPluginRegistrant/generated_pluginfiles appear to be auto-generated; it’s usually better to exclude these from commits unless there is a specific reason to check in regenerated content.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If dark mode is fully disabled, consider removing the `values-night` variant (or adding a short comment) since it now duplicates the light theme and may confuse future maintainers about whether dark mode is supported.
- The macOS and Windows `GeneratedPluginRegistrant`/`generated_plugin` files appear to be auto-generated; it’s usually better to exclude these from commits unless there is a specific reason to check in regenerated content.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Build StatusBuild successful. APKs to test: https://github.com/fossasia/pslab-app/actions/runs/22114896693/artifacts/5545794213. Screenshots |
Removed geolocator_apple plugin registration from the generated plugin registrant.
|
@sourcery-ai summary |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,7 +1,7 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
There was a problem hiding this comment.
The PR description states that changes were made to main.dart including "Replaced conditional theme logic with: themeMode: ThemeMode.light" and "Set both theme and darkTheme to use AppTheme.lightTheme". However, no diff for lib/main.dart is included in this PR.
The current code still contains:
- Line 76:
darkTheme: AppTheme.darkTheme(should be changed to AppTheme.lightTheme) - Lines 77-85: Conditional theme logic based on provider.config.theme (should be replaced with
themeMode: ThemeMode.light)
These changes are essential to actually remove dark mode support as described in the PR objectives.
| @@ -12,7 +12,7 @@ | |||
| running. | |||
|
|
|||
| This Theme is only used starting with V2 of Flutter's Android embedding. --> | |||
| <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> | |||
| <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar"> | |||
| <item name="android:windowBackground">?android:colorBackground</item> | |||
| </style> | |||
| </resources> | |||
There was a problem hiding this comment.
While the changes to use Theme.Light are correct, consider whether the values-night directory is still needed at all. Since the app will only support light mode, you could potentially remove this entire directory and rely solely on the values/styles.xml file. This would make the intent clearer and reduce maintenance overhead. However, keeping it as-is (with light themes) is also acceptable and ensures consistency regardless of system settings.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
android/app/src/main/res/values-night/styles.xml:1
- The PR description states that the main code changes include replacing conditional theme logic with 'themeMode: ThemeMode.light' and setting both 'theme' and 'darkTheme' to use 'AppTheme.lightTheme' in lib/main.dart. However, these changes are not present in the provided diffs. The current code in lib/main.dart still contains the conditional theme logic (lines 77-85) and still uses AppTheme.darkTheme (line 76). Without these changes, the dark mode implementation is not actually removed from the application code, contradicting the PR objective and issue #2999 requirements.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.







-1_instruments_screen.png?raw=true)
-2_nav_drawer.png?raw=true)
-3_accelerometer.png?raw=true)
-4_power_source.png?raw=true)
-5_multimeter.png?raw=true)
-6_wave_generator.png?raw=true)
-7_oscilloscope.png?raw=true)
Fixes #2999
Changes
themeMode: ThemeMode.lightthemeanddarkThemeto useAppTheme.lightThemeResults
• Android Emulator (API 34)
• System Dark Mode ON/OFF
• App restart
Screenshots / Recordings
The below recording shows the ui of the app when the system dark mode is 'ON' and 'OFF'.
https://github.com/user-attachments/assets/1aea9d84-fb25-4783-9cac-067bdc4920e5
Checklist:
constants.dartor localization files instead of hard-coded values.dart formator the IDE formatter.flutter analyzeand tests run influtter test.Summary by Sourcery
Force the application to always use the light theme and clean up platform-specific artifacts.
Enhancements:
Chores: