Files
kaptan/ground-suite/lib/app/theme.dart
T

101 lines
3.2 KiB
Dart

import 'package:flutter/material.dart';
/// Orkavian's restrained green accent, used sparingly against neutral surfaces.
const orkavianGreen = Color(0xff00ff41);
ThemeData groundSuiteLightTheme() => _theme(
brightness: Brightness.light,
seed: const Color(0xff007a2e),
surface: const Color(0xfff6f8f5),
onSurface: const Color(0xff172019),
outline: const Color(0xffbdc7bc),
);
ThemeData groundSuiteDarkTheme() => _theme(
brightness: Brightness.dark,
seed: orkavianGreen,
surface: const Color(0xff0a0a0a),
onSurface: const Color(0xffe7e7e7),
outline: const Color(0xff333333),
);
ThemeData _theme({
required Brightness brightness,
required Color seed,
required Color surface,
required Color onSurface,
required Color outline,
}) {
final scheme = ColorScheme.fromSeed(seedColor: seed, brightness: brightness)
.copyWith(
primary: seed,
onPrimary: brightness == Brightness.dark
? const Color(0xff031207)
: Colors.white,
surface: surface,
onSurface: onSurface,
outline: outline,
surfaceContainer: brightness == Brightness.dark
? const Color(0xff111111)
: const Color(0xffedf1ec),
);
return ThemeData(
useMaterial3: true,
colorScheme: scheme,
scaffoldBackgroundColor: Colors.transparent,
visualDensity: VisualDensity.standard,
fontFamily: 'monospace',
cardTheme: const CardThemeData(
color: Colors.transparent,
elevation: 0,
margin: EdgeInsets.zero,
),
dividerTheme: DividerThemeData(color: outline.withValues(alpha: 0.72)),
navigationRailTheme: NavigationRailThemeData(
backgroundColor: Colors.transparent,
indicatorColor: seed.withValues(
alpha: brightness == Brightness.dark ? 0.2 : 0.13,
),
selectedIconTheme: IconThemeData(color: seed),
selectedLabelTextStyle: TextStyle(
color: seed,
fontWeight: FontWeight.w700,
),
),
navigationBarTheme: NavigationBarThemeData(
backgroundColor: Colors.transparent,
indicatorColor: seed.withValues(
alpha: brightness == Brightness.dark ? 0.2 : 0.13,
),
labelTextStyle: WidgetStatePropertyAll(
TextStyle(color: onSurface, fontWeight: FontWeight.w600),
),
),
chipTheme: ChipThemeData(
backgroundColor: scheme.surfaceContainer.withValues(alpha: 0.72),
selectedColor: seed.withValues(
alpha: brightness == Brightness.dark ? 0.22 : 0.16,
),
side: BorderSide(color: outline.withValues(alpha: 0.75)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: scheme.surfaceContainer.withValues(alpha: 0.7),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: BorderSide(color: outline),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: BorderSide(color: outline.withValues(alpha: 0.8)),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: BorderSide(color: seed, width: 1.5),
),
),
);
}