easy_dynamic_theme 2.1.0
easy_dynamic_theme: ^2.1.0 copied to clipboard
Automatically get your OS defined Theme (Dynamic), force your prefered one (Light / Dark) and persist your choice in the device.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:easy_dynamic_theme/easy_dynamic_theme.dart';
import 'theme.dart';
import 'home.dart';
void main() async {
runApp(
EasyDynamicThemeWidget(
child: MyApp(),
),
);
}
class MyApp extends StatelessWidget {
final String title = 'EDT - Example';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: title,
debugShowCheckedModeBanner: false,
theme: lightThemeData,
darkTheme: darkThemeData,
themeMode: EasyDynamicTheme.of(context).themeMode,
home: new MyHomePage(
title: title,
));
}
}