207 lines
6.9 KiB
Dart
207 lines
6.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class AppTheme {
|
|
static const EdgeInsets pagePadding = EdgeInsets.fromLTRB(20, 16, 20, 24);
|
|
static const EdgeInsets panelPadding = EdgeInsets.all(16);
|
|
static const BorderRadius panelRadius = BorderRadius.all(Radius.circular(22));
|
|
|
|
static ThemeData build() {
|
|
const background = Color(0xFF05070A);
|
|
const surface = Color(0xFF101419);
|
|
const surfaceHigh = Color(0xFF151B21);
|
|
const surfaceHighest = Color(0xFF1A222B);
|
|
const outline = Color(0xFF3A4652);
|
|
const outlineVariant = Color(0xFF252E37);
|
|
const accent = Color(0xFFC2A574);
|
|
const secondary = Color(0xFF8EA3B8);
|
|
const tertiary = Color(0xFF8EB8A7);
|
|
const onSurface = Color(0xFFF3EFE7);
|
|
const subText = Color(0xFFBBB3A7);
|
|
const mutedText = Color(0xFF91897E);
|
|
|
|
final scheme = const ColorScheme.dark().copyWith(
|
|
primary: accent,
|
|
secondary: secondary,
|
|
tertiary: tertiary,
|
|
surface: surface,
|
|
surfaceContainer: surface,
|
|
surfaceContainerHigh: surfaceHigh,
|
|
surfaceContainerHighest: surfaceHighest,
|
|
outline: outline,
|
|
outlineVariant: outlineVariant,
|
|
onPrimary: onSurface,
|
|
onSecondary: onSurface,
|
|
onSurface: onSurface,
|
|
error: const Color(0xFFFF7575),
|
|
);
|
|
|
|
final base = ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
colorScheme: scheme,
|
|
scaffoldBackgroundColor: background,
|
|
canvasColor: background,
|
|
splashFactory: InkSparkle.splashFactory,
|
|
highlightColor: Colors.transparent,
|
|
hoverColor: Colors.transparent,
|
|
);
|
|
|
|
return base.copyWith(
|
|
appBarTheme: AppBarTheme(
|
|
centerTitle: false,
|
|
elevation: 0,
|
|
backgroundColor: background,
|
|
surfaceTintColor: Colors.transparent,
|
|
shadowColor: Colors.transparent,
|
|
titleTextStyle: base.textTheme.titleLarge?.copyWith(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.w800,
|
|
letterSpacing: -0.45,
|
|
),
|
|
iconTheme: const IconThemeData(color: Color(0xFFD7D0C5)),
|
|
),
|
|
textTheme: base.textTheme.copyWith(
|
|
headlineSmall: base.textTheme.headlineSmall?.copyWith(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.w800,
|
|
height: 1.02,
|
|
letterSpacing: -1.05,
|
|
),
|
|
titleMedium: base.textTheme.titleMedium?.copyWith(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.w700,
|
|
letterSpacing: -0.3,
|
|
),
|
|
titleSmall: base.textTheme.titleSmall?.copyWith(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.w700,
|
|
letterSpacing: -0.2,
|
|
),
|
|
labelLarge: base.textTheme.labelLarge?.copyWith(
|
|
color: const Color(0xFFD1C2A7),
|
|
fontWeight: FontWeight.w800,
|
|
fontSize: 11,
|
|
letterSpacing: 1.7,
|
|
),
|
|
labelMedium: base.textTheme.labelMedium?.copyWith(
|
|
color: mutedText,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 0.4,
|
|
),
|
|
bodyMedium: base.textTheme.bodyMedium?.copyWith(
|
|
color: subText,
|
|
fontWeight: FontWeight.w500,
|
|
height: 1.38,
|
|
),
|
|
bodySmall: base.textTheme.bodySmall?.copyWith(
|
|
color: mutedText,
|
|
fontWeight: FontWeight.w500,
|
|
height: 1.4,
|
|
),
|
|
),
|
|
cardTheme: const CardThemeData(
|
|
color: Colors.transparent,
|
|
elevation: 0,
|
|
margin: EdgeInsets.zero,
|
|
),
|
|
dialogTheme: DialogThemeData(
|
|
backgroundColor: surfaceHigh,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
|
|
),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
isDense: true,
|
|
filled: true,
|
|
fillColor: const Color(0xFF0C1014),
|
|
hintStyle: const TextStyle(color: mutedText),
|
|
labelStyle: const TextStyle(
|
|
color: subText,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(
|
|
horizontal: 16,
|
|
vertical: 14,
|
|
),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: const BorderSide(color: outlineVariant, width: 1),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: const BorderSide(color: outlineVariant, width: 1),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: const BorderSide(color: accent, width: 1.15),
|
|
),
|
|
disabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: const BorderSide(color: outlineVariant, width: 1),
|
|
),
|
|
),
|
|
filledButtonTheme: FilledButtonThemeData(
|
|
style: FilledButton.styleFrom(
|
|
minimumSize: const Size(0, 48),
|
|
backgroundColor: const Color(0xFFD6CBC0),
|
|
foregroundColor: const Color(0xFF14100C),
|
|
textStyle: const TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
letterSpacing: 0.15,
|
|
),
|
|
elevation: 0,
|
|
overlayColor: const Color(0x140F0C09),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
),
|
|
),
|
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
style: OutlinedButton.styleFrom(
|
|
minimumSize: const Size(0, 48),
|
|
side: const BorderSide(color: outline, width: 1),
|
|
foregroundColor: const Color(0xFFEAE2D7),
|
|
textStyle: const TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
letterSpacing: 0.15,
|
|
),
|
|
backgroundColor: const Color(0xFF14191F),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
),
|
|
),
|
|
textButtonTheme: TextButtonThemeData(
|
|
style: TextButton.styleFrom(
|
|
foregroundColor: const Color(0xFFD2BF9A),
|
|
textStyle: const TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
letterSpacing: 0.1,
|
|
),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(14),
|
|
),
|
|
),
|
|
),
|
|
iconButtonTheme: IconButtonThemeData(
|
|
style: IconButton.styleFrom(
|
|
foregroundColor: const Color(0xFFE0D9CF),
|
|
backgroundColor: Colors.transparent,
|
|
),
|
|
),
|
|
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
|
backgroundColor: Color(0xFFB89460),
|
|
foregroundColor: Color(0xFF120F0B),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(18)),
|
|
),
|
|
),
|
|
snackBarTheme: SnackBarThemeData(
|
|
behavior: SnackBarBehavior.floating,
|
|
backgroundColor: surfaceHighest,
|
|
contentTextStyle: const TextStyle(color: onSurface),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(18)),
|
|
),
|
|
dividerTheme: const DividerThemeData(color: outlineVariant, thickness: 1),
|
|
);
|
|
}
|
|
}
|