84 lines
2.7 KiB
Dart
84 lines
2.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import 'pluriwave_motion.dart';
|
|
import 'pluriwave_tokens.dart';
|
|
import 'pluriwave_typography.dart';
|
|
|
|
abstract final class PluriWaveTheme {
|
|
static ThemeData dark() {
|
|
const tokens = PluriWaveTokens.dark;
|
|
final baseTextTheme = GoogleFonts.plusJakartaSansTextTheme(
|
|
ThemeData.dark().textTheme,
|
|
);
|
|
final typography = PluriWaveTypography.from(baseTextTheme);
|
|
final colorScheme = const ColorScheme.dark().copyWith(
|
|
primary: tokens.electricMagenta,
|
|
secondary: tokens.liveGreen,
|
|
tertiary: tokens.warmCoral,
|
|
surface: const Color(0xFF0D1B24),
|
|
surfaceContainerLow: tokens.listSurface,
|
|
surfaceContainerHighest: const Color(0xFF1B3942),
|
|
onSurface: const Color(0xFFF2F7FA),
|
|
onPrimary: Colors.white,
|
|
);
|
|
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
colorScheme: colorScheme,
|
|
scaffoldBackgroundColor: tokens.deepViolet,
|
|
textTheme: baseTextTheme,
|
|
extensions: <ThemeExtension<dynamic>>[
|
|
tokens,
|
|
PluriWaveMotion.dark,
|
|
typography,
|
|
],
|
|
appBarTheme: const AppBarTheme(
|
|
centerTitle: false,
|
|
backgroundColor: Colors.transparent,
|
|
foregroundColor: Color(0xFFF2F7FA),
|
|
elevation: 0,
|
|
scrolledUnderElevation: 0,
|
|
),
|
|
navigationBarTheme: NavigationBarThemeData(
|
|
backgroundColor: Colors.transparent,
|
|
indicatorColor: tokens.electricMagenta.withValues(alpha: 0.18),
|
|
labelTextStyle: WidgetStateProperty.resolveWith(
|
|
(states) => TextStyle(
|
|
fontWeight:
|
|
states.contains(WidgetState.selected)
|
|
? FontWeight.w800
|
|
: FontWeight.w600,
|
|
fontSize: 12,
|
|
),
|
|
),
|
|
),
|
|
chipTheme: ChipThemeData(
|
|
backgroundColor: const Color(0x1FFFFFFF),
|
|
selectedColor: tokens.electricMagenta.withValues(alpha: 0.24),
|
|
side: BorderSide(color: tokens.glassBorder),
|
|
labelStyle: const TextStyle(fontWeight: FontWeight.w700),
|
|
),
|
|
cardTheme: CardThemeData(
|
|
elevation: 0,
|
|
color: colorScheme.surfaceContainerLow,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(tokens.radiusMd),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
extension PluriWaveThemeContextX on BuildContext {
|
|
PluriWaveTokens get pluriTokens =>
|
|
Theme.of(this).extension<PluriWaveTokens>() ?? PluriWaveTokens.dark;
|
|
|
|
PluriWaveMotion get pluriMotion =>
|
|
Theme.of(this).extension<PluriWaveMotion>() ?? PluriWaveMotion.dark;
|
|
|
|
PluriWaveTypography get pluriType =>
|
|
Theme.of(this).extension<PluriWaveTypography>() ??
|
|
PluriWaveTypography.from(Theme.of(this).textTheme);
|
|
}
|