banxiang/lib/theme.dart
2026-02-17 16:10:18 +08:00

80 lines
3.1 KiB
Dart

import 'package:flutter/material.dart';
class AppTheme {
static ThemeData get lightTheme {
return ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF1976D2),
brightness: Brightness.light,
primary: const Color(0xFF1976D2),
secondary: const Color(0xFF4CAF50),
surface: Colors.white,
),
scaffoldBackgroundColor: const Color(0xFFFAFAFA),
appBarTheme: const AppBarTheme(
backgroundColor: Colors.white,
foregroundColor: Color(0xFF333333),
elevation: 0,
centerTitle: true,
titleTextStyle: TextStyle(
color: Color(0xFF333333),
fontSize: 22,
fontWeight: FontWeight.w600,
),
),
cardTheme: CardTheme(
color: Colors.white,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: const BorderSide(color: Color(0xFFEEEEEE), width: 1),
),
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF1976D2),
foregroundColor: Colors.white,
minimumSize: const Size(double.infinity, 52),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
textStyle: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
),
),
textTheme: const TextTheme(
headlineLarge: TextStyle(fontSize: 28, fontWeight: FontWeight.bold, color: Color(0xFF333333)),
headlineMedium: TextStyle(fontSize: 22, fontWeight: FontWeight.w600, color: Color(0xFF333333)),
bodyLarge: TextStyle(fontSize: 18, color: Color(0xFF333333)),
bodyMedium: TextStyle(fontSize: 16, color: Color(0xFF666666)),
labelLarge: TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: Colors.white,
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: Color(0xFFDDDDDD)),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: Color(0xFFDDDDDD)),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: Color(0xFF1976D2), width: 2),
),
hintStyle: const TextStyle(fontSize: 18, color: Color(0xFFBBBBBB)),
),
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
backgroundColor: Colors.white,
selectedItemColor: Color(0xFF1976D2),
unselectedItemColor: Color(0xFF999999),
selectedLabelStyle: TextStyle(fontSize: 14, fontWeight: FontWeight.w600),
unselectedLabelStyle: TextStyle(fontSize: 14),
type: BottomNavigationBarType.fixed,
),
useMaterial3: true,
);
}
}