Skip to content

CXMM-10356 TestJira2Pr: Add dark mode to sample test app - #1

Open
ssharma-Localytics wants to merge 1 commit into
mainfrom
CXMM-10356_testjira2pr-add-dark-mode-to_v2
Open

CXMM-10356 TestJira2Pr: Add dark mode to sample test app#1
ssharma-Localytics wants to merge 1 commit into
mainfrom
CXMM-10356_testjira2pr-add-dark-mode-to_v2

Conversation

@ssharma-Localytics

@ssharma-Localytics ssharma-Localytics commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Ticket CXMM-10356

Added app-wide dark mode support by making LocalyticsSampleApp stateful with light and dark ThemeData variants, wiring themeMode on MaterialApp, and placing a top AppBar icon button to toggle between light and dark. Existing UI already reads colors and text styles from the theme, so all screens and buttons follow the selected mode. Widget tests cover the toggle button and theme switching behavior.

Testing

  • Launch the app and confirm the AppBar shows a dark-mode icon in light mode; tap it and verify the UI switches to dark colors (background, cards, buttons).
  • Tap the light-mode icon and confirm the app returns to the light theme.
  • Scroll through all sections (Privacy, Customer, Events, Profile, Appearance, Location, Inbox, Lifecycle) in both modes and confirm text, buttons, and cards remain readable.
  • Run flutter test — both widget tests should pass.

Note

Low Risk
Sample-app UI and test-only changes with no auth, data, or SDK integration changes beyond presentation.

Overview
Adds app-wide light/dark mode to the Localytics Flutter sample by making the root app stateful, defining shared light and dark ThemeData via _appTheme, and driving MaterialApp with themeMode.

An AppBar icon toggles between modes (tooltips and sun/moon icons flip with the current mode). Theme state is passed into _HomePage so the toggle lives on the home screen without changing Localytics SDK demo behavior.

Widget tests assert the toggle is present on the home screen and that tapping it updates MaterialApp.themeMode light → dark → light.

Reviewed by Cursor Bugbot for commit d713202. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

1 participant