import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'app_colors.dart'; /// [author] fengshengxiong /// [date] 2024/5/7 /// [description] 主题 /// 浅色主题 ThemeData lightTheme = ThemeData.light(useMaterial3: true).copyWith( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), primaryColor: primary, scaffoldBackgroundColor: white, appBarTheme: AppBarTheme( systemOverlayStyle: SystemUiOverlayStyle.light, backgroundColor: primary, iconTheme: const IconThemeData(color: white), elevation: 0.0, centerTitle: true, titleTextStyle: TextStyle(color: white, fontSize: 25.sp, fontWeight: FontWeight.w500), ), textSelectionTheme: const TextSelectionThemeData( cursorColor: primary, selectionHandleColor: primary, ), ); /// 深色主题 ThemeData darkTheme = ThemeData.dark(useMaterial3: true).copyWith( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), primaryColor: primary, scaffoldBackgroundColor: ThemeData.light().scaffoldBackgroundColor, appBarTheme: AppBarTheme( elevation: 0.0, systemOverlayStyle: SystemUiOverlayStyle.dark, backgroundColor: ThemeData.light().scaffoldBackgroundColor, iconTheme: const IconThemeData(color: Colors.black), ), );