tako_dynamic_theme 0.0.2 copy "tako_dynamic_theme: ^0.0.2" to clipboard
tako_dynamic_theme: ^0.0.2 copied to clipboard

A Flutter package for changing theme at a snap with persisting into the shared preferences. It is suitable for supporting multiple themes other than light and dark.

Tako Dynamic Theme #

Demo #

demo

Getting started #

  1. Add tako_dynamic_theme to your pubspec.yaml.
dependencies:
    flutter:
        sdk: flutter
    tako_dynamic_theme: x.y.z
  1. Run flutter pub get in the terminal.

Usage #

This package use key-value to index the ThemeData.

You can wrap your app by TakoDynamicTheme widget.

void main() {
  runApp(
      TakoDynamicThemeWidget(
        themeMap: {
            "light": ThemeData.light(),
            "dark": ThemeData.dark(),
            "night": ThemeConfig.nightTheme // pre-defined ThemeData
        }, 
        fallbackTheme: ThemeData.light(), 
        child: const MyApp()));
}

You can change the theme by the following code inside widget.

TakoDynamicTheme.of(context).changeTheme(themeKey: "night"),

You can checkout the example in this repository.

cd example
flutter run
1
likes
90
pub points
0%
popularity

Publisher

unverified uploader

A Flutter package for changing theme at a snap with persisting into the shared preferences. It is suitable for supporting multiple themes other than light and dark.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, shared_preferences

More

Packages that depend on tako_dynamic_theme