theme_provider 0.0.1+1 copy "theme_provider: ^0.0.1+1" to clipboard
theme_provider: ^0.0.1+1 copied to clipboard

outdated

Easy to use, customizable and pluggable Theme Provider.

theme_provider #

Easy to use, customizable and pluggable Theme Provider.

This is still a work in progress.

Include in your project #

dependencies:
  theme_provider: ^0.0.1

run packages get and import it

import 'package:theme_provider/theme_provider.dart';

if you want the dialog:

import 'package:theme_provider/theme_provider.dart';

Usage #

Wrap your material app like this:

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ThemeProvider(
      themes: <AppTheme>[
        AppTheme(data: ThemeData.light()),
        AppTheme(data: ThemeData.dark()),
      ],
      app: MaterialApp(
        home: HomePage(),
      ),
    );
  }
}

To change the theme:

 ThemeCommand.of(context).nextTheme();

Access theme data using default method:

 Theme.of(context).data

TODO #

  • Add next theme command
  • Add theme cycling widget
  • Add theme selection by theme id
  • Add theme select and preview widget
  • Persist current selected theme
  • Add unit tests and example

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

299
likes
0
pub points
95%
popularity

Publisher

unverified uploader

Easy to use, customizable and pluggable Theme Provider.

Homepage

License

unknown (LICENSE)

Dependencies

flutter, provider

More

Packages that depend on theme_provider