Skip to content

Conversation

@manishraj-003
Copy link

@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

Enforce a consistent light UI theme across platforms and align desktop plugin registration with existing geolocation dependencies.

New Features:

  • Enable geolocation plugin registration on Windows and macOS via geolocator platform plugins.

Enhancements:

  • Update Android night-mode launch and normal themes to use light variants so the app always presents a light theme regardless of system dark mode settings.

Build:

  • Add Windows CMake plugin list entry for the geolocator Windows plugin.

@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/20554651621/artifacts/4978782588.

Screenshots

Android Screenshots
iPhone Screenshots
iPad Screenshots

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

1 participant