FLUTTER ECOSYSTEM

theme_mode_handler

Flutter widget to change `themeMode` during runtime and persist it across restarts

Latest version
3.0.0
30-day downloads
261
Likes
19
Pub points
160

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

A Flutter package that enables dynamic theme mode switching at runtime and persists the selected theme across app restarts. It simplifies handling light and dark mode preferences by automatically saving the user's choice to shared preferences, ensuring consistency when the app is reopened. The widget integrates seamlessly into existing Flutter apps with minimal setup, offering a reliable way to manage theme state without manual storage logic.

Use cases
  • Dynamic theme switching in mobile apps
  • Persisting user theme preference across sessions
  • Implementing dark mode toggle in web applications
  • Supporting system theme awareness
  • Enabling theme customization in desktop apps
Key features
  • Runtime theme mode changes
  • Automatic persistence using shared preferences
  • Simple integration with MaterialApp
  • Supports all major platforms
  • Configurable default theme mode
Suitable for
  • Developers building apps with theme toggles
  • Apps requiring persistent user theme settings
  • Cross-platform applications targeting multiple devices
Considerations
  • Requires shared_preferences dependency
  • Limited to themeMode only (not full theme customization)
  • May need additional logic for custom themes
  • Not suitable for complex theme management beyond mode switching
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add theme_mode_handler

Categories

Source repository

Related projects