2024-03-18 13:23:58 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
|
|
|
|
|
|
|
|
class AppTheme {
|
|
|
|
AppTheme._();
|
2024-03-18 15:54:06 +08:00
|
|
|
static const Color primaryColor = Color(0xFFC89607);
|
2024-03-19 11:09:07 +08:00
|
|
|
static const Color primaryColorLight = Color.fromARGB(255, 255, 206, 70);
|
2024-03-19 13:27:42 +08:00
|
|
|
static const Color primaryColorDark = Color.fromARGB(255, 163, 120, 0);
|
|
|
|
|
|
|
|
static const Color secondPrimaryColor = Color(0xFFc12a3a);
|
|
|
|
static const Color secondPrimaryColorLight = Color.fromARGB(255, 230, 79, 94);
|
|
|
|
static const Color secondPrimaryColorDark = Color.fromARGB(255, 141, 12, 25);
|
|
|
|
|
2024-03-18 13:23:58 +08:00
|
|
|
static const Color white = Color(0xFFFFFFFF);
|
2024-03-18 15:54:06 +08:00
|
|
|
static const Color nearlyWhite = Color(0xFFFEFEFE);
|
|
|
|
static const Color black = Color(0xFF000000);
|
2024-03-18 13:23:58 +08:00
|
|
|
static const Color nearlyBlack = Color(0xFF213333);
|
|
|
|
static const Color grey = Color(0xFF3A5160);
|
|
|
|
static const Color snackbarErrorBackgroudColor = Colors.red;
|
|
|
|
static const Color snackbarSuccessBackgroudColor = Colors.green;
|
|
|
|
static const Color snackbarWarningBackgroudColor = Colors.orange;
|
2024-03-19 08:59:08 +08:00
|
|
|
static Color barrierColor = Colors.black.withOpacity(0.5);
|
2024-03-18 13:23:58 +08:00
|
|
|
static const String fontName = 'NotoSans';
|
2024-03-19 11:09:07 +08:00
|
|
|
static const Color activeNavigationBarColor = primaryColor;
|
|
|
|
static const Color notActiveNavigationBarColor = Colors.grey;
|
2024-03-20 09:37:20 +08:00
|
|
|
static const Color dividerColor = Color.fromARGB(255, 197, 197, 197);
|
2024-03-18 13:23:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
final theme = ThemeData(
|
|
|
|
fontFamily: AppTheme.fontName,
|
|
|
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
|
|
|
primaryColor: AppTheme.primaryColor,
|
|
|
|
primaryColorDark: AppTheme.primaryColorDark,
|
|
|
|
progressIndicatorTheme:
|
2024-03-18 15:54:06 +08:00
|
|
|
const ProgressIndicatorThemeData(color: AppTheme.primaryColor),
|
2024-03-20 09:37:20 +08:00
|
|
|
dividerColor: AppTheme.dividerColor,
|
2024-03-18 15:54:06 +08:00
|
|
|
cardColor: AppTheme.white,
|
|
|
|
scaffoldBackgroundColor: AppTheme.nearlyWhite,
|
2024-03-19 08:59:08 +08:00
|
|
|
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
|
|
|
backgroundColor: AppTheme.nearlyWhite,
|
|
|
|
unselectedLabelStyle: TextStyle(fontSize: ScreenAdaper.sp(20)),
|
|
|
|
selectedLabelStyle: TextStyle(fontSize: ScreenAdaper.sp(20)),
|
|
|
|
selectedItemColor: AppTheme.primaryColor),
|
2024-03-18 13:23:58 +08:00
|
|
|
tabBarTheme: TabBarTheme(
|
|
|
|
indicator: BoxDecoration(
|
|
|
|
border:
|
|
|
|
Border(bottom: BorderSide(width: 3, color: AppTheme.primaryColorDark)),
|
|
|
|
)),
|
|
|
|
appBarTheme: AppBarTheme(
|
|
|
|
centerTitle: true,
|
2024-03-18 15:54:06 +08:00
|
|
|
iconTheme: const IconThemeData(color: Colors.black),
|
2024-03-18 13:23:58 +08:00
|
|
|
backgroundColor: AppTheme.primaryColor,
|
|
|
|
titleTextStyle: TextStyle(
|
|
|
|
color: Colors.black,
|
2024-03-19 08:59:08 +08:00
|
|
|
fontSize: ScreenAdaper.sp(25),
|
2024-03-18 13:23:58 +08:00
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
2024-03-18 15:54:06 +08:00
|
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
|
|
floatingLabelStyle: TextStyle(
|
|
|
|
color: AppTheme.primaryColor,
|
|
|
|
fontSize: ScreenAdaper.sp(30),
|
|
|
|
),
|
|
|
|
labelStyle: TextStyle(
|
|
|
|
fontSize: ScreenAdaper.sp(25),
|
|
|
|
),
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderRadius: BorderRadius.circular(ScreenAdaper.sp(15))),
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
borderRadius: BorderRadius.circular(ScreenAdaper.sp(15)),
|
|
|
|
borderSide: BorderSide(
|
|
|
|
color: AppTheme.primaryColorLight, width: 2), // 选中时的边框颜色和宽度
|
|
|
|
),
|
|
|
|
),
|
2024-03-18 13:23:58 +08:00
|
|
|
);
|