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

outdated

Easy to use, customizable and pluggable Theme Provider. This Widget can be used to easily provide a theme controller across the widget tree.

example/lib/main.dart

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

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

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

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Example App"),
      ),
      body: Center(
        child: OutlineButton(
          child: Text("Next Theme"),
          onPressed: ThemeCommand.of(context).nextTheme,
        ),
      ),
    );
  }
}
308
likes
0
pub points
94%
popularity

Publisher

unverified uploader

Easy to use, customizable and pluggable Theme Provider. This Widget can be used to easily provide a theme controller across the widget tree.

Homepage

License

unknown (license)

Dependencies

flutter, provider

More

Packages that depend on theme_provider