theme_mode_toggle 1.0.0
theme_mode_toggle: ^1.0.0 copied to clipboard
A customizable animated Material switch for toggling between light and dark theme modes in Flutter apps.
theme_mode_toggle #
A customizable, animated Material switch for toggling between light and dark theme modes in Flutter apps.
Features #
- Smooth animated thumb slide with configurable duration and curve
- Sun / moon icons that swap as the value changes
- Fully customizable size, colors, icons, and border radius
- Accessible out of the box (
Semanticslabel and toggled state) - Can be disabled via the
enabledproperty
Getting started #
Add the package to your pubspec.yaml:
dependencies:
theme_mode_toggle: ^1.0.0
Then import it:
import 'package:theme_mode_toggle/theme_mode_toggle.dart';
Usage #
bool isDarkMode = false;
ThemeModeToggle(
value: isDarkMode,
onChanged: (value) {
setState(() {
isDarkMode = value;
});
},
)
A full example wiring the toggle up to MaterialApp.themeMode is available
in the example directory.
Additional information #
Contributions and issue reports are welcome — please open an issue or pull request on the GitHub repository.