light_dark_theme_toggle 1.0.2 copy "light_dark_theme_toggle: ^1.0.2" to clipboard
light_dark_theme_toggle: ^1.0.2 copied to clipboard

An animated, customizable Flutter widget for switching between light and dark modes with a visually appealing toggle.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:light_dark_theme_toggle/light_dark_theme_toggle.dart';

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool isDarkMode = false;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: isDarkMode ? ThemeData.dark() : ThemeData.light(),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Light/Dark Theme Toggle Example'),
          actions: [
            Padding(
              padding: const EdgeInsets.only(right: 16.0),
              child: LightDarkThemeToggle(
                value: isDarkMode,
                onChanged: (value) {
                  setState(() {
                    isDarkMode = value;
                  });
                },
              ),
            ),
          ],
        ),
        body: Center(child: Text('Toggle the toggle!')),
      ),
    );
  }
}
10
likes
0
points
55
downloads

Publisher

unverified uploader

Weekly Downloads

An animated, customizable Flutter widget for switching between light and dark modes with a visually appealing toggle.

Homepage
Repository (GitHub)
View/report issues

Topics

#theme-toggle #switch #toggle #widget #animation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on light_dark_theme_toggle