From 4c3ea317c3c2daaa0faccac3a3055f45ebd39c59 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Fri, 8 Apr 2022 14:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20apptheme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/app_theme.dart | 93 ++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a/lib/constants/app_theme.dart b/lib/constants/app_theme.dart index f1ec0a96..eac2a8af 100644 --- a/lib/constants/app_theme.dart +++ b/lib/constants/app_theme.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; - import 'package:flutter_screenutil/flutter_screenutil.dart'; class AppTheme { @@ -10,28 +9,63 @@ class AppTheme { ProgressIndicatorThemeData(color: Color(0xFFFFD000)), primaryColor: Color(0xFFFFD000), textTheme: ThemeData.light().textTheme.copyWith( - headline3: TextStyle( - fontSize: 40.sp, - color: Color(0xFF333333), - fontWeight: FontWeight.bold, - ), - subtitle1: TextStyle( - fontSize: 32.sp, - color: Color(0xFF333333), - ), - subtitle2: TextStyle( - fontSize: 28.sp, - color: Color(0xFF333333), - ), - bodyText1: TextStyle( - fontSize: 24.sp, - color: Color(0xFF333333), - ), + caption: TextStyle( + fontSize: 28.sp, + color: Color(0xFF333333), + ), + overline: TextStyle( + fontSize: 32.sp, + color: Color(0xFF333333), + ), + headline1: TextStyle( + fontSize: 28.sp, + color: Color(0xFF333333), + fontWeight: FontWeight.bold, + ), + headline2: TextStyle( + fontSize: 30.sp, + color: Color(0xFF333333), + fontWeight: FontWeight.bold, + ), + headline3: TextStyle( + fontSize: 32.sp, + color: Color(0xFF333333), + fontWeight: FontWeight.bold, + ), + headline4: TextStyle( + fontSize: 36.sp, + color: Color(0xFF333333), + fontWeight: FontWeight.bold, ), + headline5: TextStyle( + fontSize: 40.sp, + color: Color(0xFF333333), + fontWeight: FontWeight.bold, + ), + subtitle1: TextStyle( + fontSize: 32.sp, + color: Color(0xFF333333), + ), + subtitle2: TextStyle( + fontSize: 28.sp, + color: Color(0xFF333333), + ), + bodyText1: TextStyle( + fontSize: 24.sp, + color: Color(0xFF333333), + ), + bodyText2: TextStyle( + fontSize: 28.sp, + color: Color(0xFF333333), + ), + button: TextStyle( + fontSize: 28.sp, + color: Color(0xFF333333), + )), floatingActionButtonTheme: FloatingActionButtonThemeData().copyWith( backgroundColor: Color(0xFFFFD000), ), - appBarTheme: AppBarTheme( + appBarTheme: AppBarTheme().copyWith( elevation: 0, centerTitle: true, iconTheme: IconThemeData( @@ -46,25 +80,24 @@ class AppTheme { ), ).bodyText2, titleTextStyle: TextTheme( - headline6: TextStyle( + headline3: TextStyle( color: Color(0xFF333333), - fontSize: 36.sp, + fontSize: 32.sp, fontWeight: FontWeight.bold, ), - ).headline6, + ).headline3, ), - tabBarTheme: TabBarTheme( + tabBarTheme: TabBarTheme().copyWith( labelColor: Color(0xFF333333), labelStyle: TextStyle( - fontSize: 28.sp, - fontWeight: FontWeight.w600, - ), - unselectedLabelStyle: TextStyle( - fontSize: 28.sp, + fontSize: 30.sp, + fontWeight: FontWeight.bold, ), + unselectedLabelStyle: + TextStyle(fontSize: 28.sp, fontWeight: FontWeight.normal), indicatorSize: TabBarIndicatorSize.label, ), - bottomNavigationBarTheme: BottomNavigationBarThemeData( + bottomNavigationBarTheme: BottomNavigationBarThemeData().copyWith( selectedItemColor: Color(0xFF333333), selectedLabelStyle: TextStyle( fontWeight: FontWeight.bold, @@ -72,7 +105,7 @@ class AppTheme { type: BottomNavigationBarType.fixed, unselectedLabelStyle: TextStyle(), ), - radioTheme: RadioThemeData( + radioTheme: RadioThemeData().copyWith( fillColor: MaterialStateProperty.resolveWith((states) { if (states.contains(MaterialState.selected)) return Color(0xFFFFD000); return null;