theme_provider 0.0.1 theme_provider: ^0.0.1 copied to clipboard
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.