Created
February 13, 2023 14:11
-
-
Save bkhezry/cc9c14c2c0f98696551750d2ae627305 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:get/get.dart'; | |
class ThemeUtil { | |
static ThemeData themeData(bool isDarkTheme, BuildContext context) { | |
return ThemeData( | |
pageTransitionsTheme: const PageTransitionsTheme(builders: { | |
TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(), | |
TargetPlatform.iOS: FadeUpwardsPageTransitionsBuilder(), | |
}), | |
fontFamily: 'IranYekan', | |
scaffoldBackgroundColor: | |
isDarkTheme ? const Color(0xff1d3041) : Colors.white, | |
colorScheme: ColorScheme.light( | |
primary: const Color(0xff0071bb), | |
primaryContainer: | |
isDarkTheme ? const Color(0xFF173F67) : const Color(0xFF113F6A), | |
secondary: | |
isDarkTheme ? const Color(0xFF1ecad3) : const Color(0xFF1ecad3), | |
secondaryContainer: | |
isDarkTheme ? Colors.white : const Color(0xff0071bb), | |
background: isDarkTheme ? const Color(0xff1d3041) : Colors.white, | |
surface: | |
isDarkTheme ? const Color(0xff2f4050) : const Color(0xffeeeeee), | |
error: isDarkTheme ? const Color(0xFFDE3F3F) : const Color(0xFFC52F2F), | |
onPrimary: Colors.white, | |
onSecondary: Colors.white, | |
onBackground: isDarkTheme ? Colors.white : Colors.black, | |
onSurface: isDarkTheme ? Colors.white : Colors.black, | |
onError: Colors.white, | |
brightness: isDarkTheme ? Brightness.dark : Brightness.light, | |
), | |
appBarTheme: const AppBarTheme( | |
elevation: 0.0, | |
), | |
iconTheme: IconThemeData( | |
color: isDarkTheme ? Colors.white : const Color(0xff1ecad3)), | |
selectedRowColor: isDarkTheme ? const Color(0xff4a5a68) : Colors.white, | |
primaryColor: | |
isDarkTheme ? const Color(0xff2f4050) : const Color(0xffeffcff), | |
primaryColorDark: | |
isDarkTheme ? const Color(0xff1d3041) : const Color(0xffeffcff), | |
textTheme: TextTheme( | |
headline1: TextStyle( | |
color: isDarkTheme ? Colors.white : const Color(0xff2cb1b8), | |
), | |
bodyText1: TextStyle( | |
color: isDarkTheme ? Colors.white : const Color(0xff777777), | |
), | |
bodyText2: TextStyle( | |
color: isDarkTheme ? Colors.white : Colors.black, | |
), | |
), | |
unselectedWidgetColor: | |
isDarkTheme ? const Color(0xFF7998B6) : const Color(0xFF7998B6), | |
); | |
} | |
static Color shadowColor = const Color(0x26000000); | |
static Color homePageBackgroundLightColor = const Color(0xffdcfdff); | |
static Color borderColor = const Color(0xffdcdcdc); | |
static const Color hintColor = Color(0xff9eacba); | |
static const Color blackTextColor = Colors.black; | |
static getBoxShadow() { | |
return BoxShadow( | |
color: Get.isDarkMode ? Colors.transparent : ThemeUtil.shadowColor, | |
offset: const Offset(0, 3), | |
blurRadius: 9, | |
spreadRadius: 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment