140 lines
4.7 KiB
Dart
140 lines
4.7 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(24));
|
|
|
|
static ThemeData build() {
|
|
const background = Color(0xFF09111C);
|
|
const surface = Color(0xFF111C2C);
|
|
const surfaceHigh = Color(0xFF182538);
|
|
const surfaceHighest = Color(0xFF1E2E45);
|
|
const outline = Color(0xFF2C405F);
|
|
const outlineVariant = Color(0xFF22324A);
|
|
const accent = Color(0xFF67CFFF);
|
|
const secondary = Color(0xFF7AA6FF);
|
|
const tertiary = Color(0xFF77E3CF);
|
|
|
|
final scheme = const ColorScheme.dark().copyWith(
|
|
primary: accent,
|
|
secondary: secondary,
|
|
tertiary: tertiary,
|
|
surface: surface,
|
|
surfaceContainer: surface,
|
|
surfaceContainerHigh: surfaceHigh,
|
|
surfaceContainerHighest: surfaceHighest,
|
|
outline: outline,
|
|
outlineVariant: outlineVariant,
|
|
error: const Color(0xFFFF7575),
|
|
);
|
|
|
|
final base = ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
colorScheme: scheme,
|
|
scaffoldBackgroundColor: background,
|
|
canvasColor: background,
|
|
splashFactory: InkSparkle.splashFactory,
|
|
);
|
|
|
|
return base.copyWith(
|
|
appBarTheme: AppBarTheme(
|
|
centerTitle: false,
|
|
elevation: 0,
|
|
backgroundColor: background,
|
|
surfaceTintColor: Colors.transparent,
|
|
titleTextStyle: base.textTheme.titleLarge?.copyWith(
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
textTheme: base.textTheme.copyWith(
|
|
headlineSmall: base.textTheme.headlineSmall?.copyWith(
|
|
fontWeight: FontWeight.w700,
|
|
letterSpacing: -0.4,
|
|
),
|
|
titleMedium: base.textTheme.titleMedium?.copyWith(
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleSmall: base.textTheme.titleSmall?.copyWith(
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
labelLarge: base.textTheme.labelLarge?.copyWith(
|
|
fontWeight: FontWeight.w700,
|
|
letterSpacing: 0.4,
|
|
),
|
|
bodySmall: base.textTheme.bodySmall?.copyWith(
|
|
color: const Color(0xFFA4B4CB),
|
|
),
|
|
),
|
|
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: surface,
|
|
hintStyle: const TextStyle(color: Color(0xFF8195B2)),
|
|
labelStyle: const TextStyle(color: Color(0xFFAFC1DB)),
|
|
contentPadding: const EdgeInsets.symmetric(
|
|
horizontal: 16,
|
|
vertical: 14,
|
|
),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: const BorderSide(color: outlineVariant),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: const BorderSide(color: outlineVariant),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: const BorderSide(color: accent),
|
|
),
|
|
),
|
|
filledButtonTheme: FilledButtonThemeData(
|
|
style: FilledButton.styleFrom(
|
|
minimumSize: const Size(0, 48),
|
|
backgroundColor: accent,
|
|
foregroundColor: const Color(0xFF05111D),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
),
|
|
),
|
|
),
|
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
style: OutlinedButton.styleFrom(
|
|
minimumSize: const Size(0, 48),
|
|
side: const BorderSide(color: outline),
|
|
foregroundColor: const Color(0xFFE8F1FF),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
),
|
|
),
|
|
),
|
|
iconButtonTheme: IconButtonThemeData(
|
|
style: IconButton.styleFrom(foregroundColor: const Color(0xFFD7E4F8)),
|
|
),
|
|
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
|
backgroundColor: accent,
|
|
foregroundColor: Color(0xFF05111D),
|
|
),
|
|
snackBarTheme: SnackBarThemeData(
|
|
behavior: SnackBarBehavior.floating,
|
|
backgroundColor: surfaceHighest,
|
|
contentTextStyle: const TextStyle(color: Color(0xFFF2F7FF)),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(18)),
|
|
),
|
|
dividerTheme: const DividerThemeData(color: outlineVariant, thickness: 1),
|
|
);
|
|
}
|
|
}
|