Skip to content

Comments

chore: Remove current dark mode implementation#3007

Merged
marcnause merged 6 commits intofossasia:flutterfrom
manishraj-003:issue2999
Feb 17, 2026
Merged

chore: Remove current dark mode implementation#3007
marcnause merged 6 commits intofossasia:flutterfrom
manishraj-003:issue2999

Conversation

@manishraj-003
Copy link
Contributor

@manishraj-003 manishraj-003 commented Dec 19, 2025

Fixes #2999

Changes

  • Replaced conditional theme logic with: themeMode: ThemeMode.light
  • Set both theme and darkTheme to use AppTheme.lightTheme
  • Ensures consistent UI and removes unexpected dark mode usage.

Results

  • App always stays in Light mode, even when device is in Dark mode
  • Verified on:
    • Android Emulator (API 34)
    • System Dark Mode ON/OFF
    • App restart
  • No visual/UI regressions introduced

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:

  • No hard coding: I have used values from constants.dart or localization files instead of hard-coded values.
  • No end of file edits: No modifications done at end of resource files.
  • Code reformatting: I have formatted the code using dart format or the IDE formatter.
  • Code analysis: My code passes checks run in flutter analyze and tests run in flutter test.

Summary by Sourcery

Force the application to always use the light theme and clean up platform-specific artifacts.

Enhancements:

  • Update Android night-mode styles so launch and normal themes use light variants instead of dark ones.

Chores:

  • Remove obsolete Windows Flutter generated plugin registrant files from version control.
  • Update dependency lockfile to reflect current package state.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 19, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Forces 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 theme

sequenceDiagram
  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
Loading

File-Level Changes

Change Details Files
Force Android startup and normal app UI to use a light theme even when the system is in dark mode.
  • Changed the Android night-mode LaunchTheme parent from a dark theme to a light, no-title-bar theme so the splash/startup window is always light.
  • Changed the Android night-mode NormalTheme parent from a dark theme to a light, no-title-bar theme so the base activity window is always light.
android/app/src/main/res/values-night/styles.xml
Ensure geolocation works on desktop by registering geolocator plugins for Windows and macOS builds.
  • Imported the Windows geolocator plugin header and registered GeolocatorWindows with the Flutter plugin registry.
  • Added geolocator_windows to the list of Windows Flutter plugins in the generated CMake configuration.
  • Imported the macOS geolocator_apple plugin and registered GeolocatorPlugin in the macOS generated plugin registrant.
windows/flutter/generated_plugin_registrant.cc
windows/flutter/generated_plugins.cmake
macos/Flutter/GeneratedPluginRegistrant.swift

Assessment against linked issues

Issue Objective Addressed Explanation
#2999 Remove the existing dark mode theme and all related dark-mode-specific code from the app.
#2999 Ensure the app always and consistently uses the standard light theme, regardless of system dark mode settings.
#2999 Clean up styling that assumes dark mode and verify that all screens display correctly under the light theme.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 19, 2025

Build Status

Build successful. APKs to test: https://github.com/fossasia/pslab-app/actions/runs/22114896693/artifacts/5545794213.

Screenshots

Android Screenshots
iPhone Screenshots
iPad Screenshots

This comment was marked as outdated.

Removed geolocator_apple plugin registration from the generated plugin registrant.

This comment was marked as outdated.

@marcnause
Copy link
Contributor

@sourcery-ai summary

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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"?>
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 18
@@ -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>
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

@marcnause marcnause left a comment

Choose a reason for hiding this comment

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

Tested on my device

@marcnause marcnause enabled auto-merge (squash) February 17, 2026 20:50
@marcnause marcnause merged commit 123f24b into fossasia:flutter Feb 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove current Dark Mode implementation

2 participants