theme_button 1.0.4 copy "theme_button: ^1.0.4" to clipboard
theme_button: ^1.0.4 copied to clipboard

Theme button provides a switch widget for night/light modes on Android,iOS, WEB and Desktop

example/lib/main.dart

import 'dart:developer';

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData.dark(),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Demo'),
      ),
      body: Center(
        child: ThemeButton(
          onChanged: (value) {
            log('$value');
          },
        ),
      ),
    );
  }
}
12
likes
160
points
37
downloads

Publisher

unverified uploader

Weekly Downloads

Theme button provides a switch widget for night/light modes on Android,iOS, WEB and Desktop

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, lottie

More

Packages that depend on theme_button