theme_mode_toggle 1.0.0 copy "theme_mode_toggle: ^1.0.0" to clipboard
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 (Semantics label and toggled state)
  • Can be disabled via the enabled property

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.

0
likes
160
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A customizable animated Material switch for toggling between light and dark theme modes in Flutter apps.

Repository (GitHub)
View/report issues

Topics

#flutter #theme #dark-mode #light-mode #toggle

License

MIT (license)

Dependencies

flutter

More

Packages that depend on theme_mode_toggle