mobile_skt/lib/app_theme.dart

74 lines
2.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
class AppTheme {
AppTheme._();
static const Color primaryColor = Color(0xFFC89607);
static const Color primaryColorLight = Color.fromARGB(255, 255, 206, 70);
static Color primaryColorDark = Color.fromRGBO(
primaryColor.red,
primaryColor.green,
primaryColor.blue,
1 - primaryColor.computeLuminance(),
);
static const Color white = Color(0xFFFFFFFF);
static const Color nearlyWhite = Color(0xFFFEFEFE);
static const Color black = Color(0xFF000000);
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;
static Color barrierColor = Colors.black.withOpacity(0.5);
static const String fontName = 'NotoSans';
static const Color activeNavigationBarColor = primaryColor;
static const Color notActiveNavigationBarColor = Colors.grey;
}
final theme = ThemeData(
fontFamily: AppTheme.fontName,
visualDensity: VisualDensity.adaptivePlatformDensity,
primaryColor: AppTheme.primaryColor,
primaryColorDark: AppTheme.primaryColorDark,
progressIndicatorTheme:
const ProgressIndicatorThemeData(color: AppTheme.primaryColor),
dividerColor: AppTheme.grey,
cardColor: AppTheme.white,
scaffoldBackgroundColor: AppTheme.nearlyWhite,
bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: AppTheme.nearlyWhite,
unselectedLabelStyle: TextStyle(fontSize: ScreenAdaper.sp(20)),
selectedLabelStyle: TextStyle(fontSize: ScreenAdaper.sp(20)),
selectedItemColor: AppTheme.primaryColor),
tabBarTheme: TabBarTheme(
indicator: BoxDecoration(
border:
Border(bottom: BorderSide(width: 3, color: AppTheme.primaryColorDark)),
)),
appBarTheme: AppBarTheme(
centerTitle: true,
iconTheme: const IconThemeData(color: Colors.black),
backgroundColor: AppTheme.primaryColor,
titleTextStyle: TextStyle(
color: Colors.black,
fontSize: ScreenAdaper.sp(25),
fontWeight: FontWeight.bold),
),
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), // 选中时的边框颜色和宽度
),
),
);