修改 apptheme

pull/1/head
张萌 3 years ago
parent 0df7dfb76c
commit 4c3ea317c3

@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class AppTheme { class AppTheme {
@ -10,28 +9,63 @@ class AppTheme {
ProgressIndicatorThemeData(color: Color(0xFFFFD000)), ProgressIndicatorThemeData(color: Color(0xFFFFD000)),
primaryColor: Color(0xFFFFD000), primaryColor: Color(0xFFFFD000),
textTheme: ThemeData.light().textTheme.copyWith( textTheme: ThemeData.light().textTheme.copyWith(
headline3: TextStyle( caption: TextStyle(
fontSize: 40.sp, fontSize: 28.sp,
color: Color(0xFF333333), color: Color(0xFF333333),
fontWeight: FontWeight.bold, ),
), overline: TextStyle(
subtitle1: TextStyle( fontSize: 32.sp,
fontSize: 32.sp, color: Color(0xFF333333),
color: Color(0xFF333333), ),
), headline1: TextStyle(
subtitle2: TextStyle( fontSize: 28.sp,
fontSize: 28.sp, color: Color(0xFF333333),
color: Color(0xFF333333), fontWeight: FontWeight.bold,
), ),
bodyText1: TextStyle( headline2: TextStyle(
fontSize: 24.sp, fontSize: 30.sp,
color: Color(0xFF333333), 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( floatingActionButtonTheme: FloatingActionButtonThemeData().copyWith(
backgroundColor: Color(0xFFFFD000), backgroundColor: Color(0xFFFFD000),
), ),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme().copyWith(
elevation: 0, elevation: 0,
centerTitle: true, centerTitle: true,
iconTheme: IconThemeData( iconTheme: IconThemeData(
@ -46,25 +80,24 @@ class AppTheme {
), ),
).bodyText2, ).bodyText2,
titleTextStyle: TextTheme( titleTextStyle: TextTheme(
headline6: TextStyle( headline3: TextStyle(
color: Color(0xFF333333), color: Color(0xFF333333),
fontSize: 36.sp, fontSize: 32.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
).headline6, ).headline3,
), ),
tabBarTheme: TabBarTheme( tabBarTheme: TabBarTheme().copyWith(
labelColor: Color(0xFF333333), labelColor: Color(0xFF333333),
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 28.sp, fontSize: 30.sp,
fontWeight: FontWeight.w600, fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 28.sp,
), ),
unselectedLabelStyle:
TextStyle(fontSize: 28.sp, fontWeight: FontWeight.normal),
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
), ),
bottomNavigationBarTheme: BottomNavigationBarThemeData( bottomNavigationBarTheme: BottomNavigationBarThemeData().copyWith(
selectedItemColor: Color(0xFF333333), selectedItemColor: Color(0xFF333333),
selectedLabelStyle: TextStyle( selectedLabelStyle: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -72,7 +105,7 @@ class AppTheme {
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
unselectedLabelStyle: TextStyle(), unselectedLabelStyle: TextStyle(),
), ),
radioTheme: RadioThemeData( radioTheme: RadioThemeData().copyWith(
fillColor: MaterialStateProperty.resolveWith<Color?>((states) { fillColor: MaterialStateProperty.resolveWith<Color?>((states) {
if (states.contains(MaterialState.selected)) return Color(0xFFFFD000); if (states.contains(MaterialState.selected)) return Color(0xFFFFD000);
return null; return null;

Loading…
Cancel
Save