flutter_theme_manager 0.0.2+9
flutter_theme_manager: ^0.0.2+9 copied to clipboard
We Provide light and dark theme in very simple way. we Know that passing the theme in whole app is very difficult and we need to write lot of code only for theme.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_theme_manager/flutter_theme_manager.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return buildBlocBuilder(home:Home());
}
}
class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: AppTheme.theme(context: context, lightTheme: Colors.red, darkTheme: Colors.blue),
title: Text(
"AppBar",
style: TextStyle(
color: AppTheme.theme(
context: context, darkTheme: Colors.black, lightTheme: Colors.red)),
),
actions: [
InkWell(
child: Center(
child: Text(
"theme ",
style: TextStyle(
color: AppTheme.theme(
context: context,
darkTheme: Colors.white,
lightTheme: Colors.black)),
)),
onTap: () {
changeTheme(context),
},
),
TextButton(onPressed: (){
Navigator.of(context).push(MaterialPageRoute(builder: (_)=> Home1()));
}, child: Text("Next"))
],
),
body: Column(
children: [
Text(" Flutter.dev ",style: TextStyle(color:AppTheme.theme(context: context,lightTheme: Color(0xffffffff),darkTheme:Colors.yellow ) ),),
],
),
);
}
}