Commit 76787b8c authored by Kaushan H.K.R's avatar Kaushan H.K.R

themes setup

parent d6627cfe
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
const Color primaryColor = Colors.green;
ThemeData lightTheme = ThemeData(
textTheme: GoogleFonts.latoTextTheme(),
brightness: Brightness.light,
primaryTextTheme: const TextTheme(),
colorScheme: const ColorScheme.light(
primary: primaryColor,
),
appBarTheme: const AppBarTheme(
backgroundColor: primaryColor,
elevation: 0,
iconTheme: IconThemeData(
color: Colors.white,
),
titleTextStyle: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 20,
),
),
drawerTheme: const DrawerThemeData(
elevation: 0,
backgroundColor: Colors.white,
endShape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: primaryColor,
foregroundColor: Colors.white,
),
primaryColor: primaryColor,
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
backgroundColor: Colors.white,
selectedItemColor: primaryColor,
unselectedItemColor: Colors.black,
selectedIconTheme: IconThemeData(
color: primaryColor,
),
unselectedIconTheme: IconThemeData(
color: Colors.black,
),
selectedLabelStyle: TextStyle(
fontWeight: FontWeight.w600,
),
unselectedLabelStyle: TextStyle(
fontWeight: FontWeight.w600,
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.fromLTRB(30, 15, 30, 15),
textStyle: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
backgroundColor: primaryColor,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
),
),
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
),
focusColor: primaryColor,
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(color: primaryColor),
),
),
);
ThemeData darkTheme = ThemeData(
brightness: Brightness.dark,
);
import 'package:flutter/material.dart';
class ThemeManager with ChangeNotifier {
ThemeMode _themeMode = ThemeMode.light;
get themeMode => _themeMode;
toggleTheme(bool isDark) {
_themeMode = isDark ? ThemeMode.dark : ThemeMode.light;
notifyListeners();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment