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.

Libraries

theme_mode_toggle
A customizable animated switch widget for toggling between light and dark theme modes.