testsAndMisc-archive/pomodoro_app/lib/theme/pomodoro_theme.dart

71 lines
2.1 KiB
Dart
Raw Normal View History

2026-02-21 20:40:33 +01:00
import 'package:flutter/material.dart';
import 'package:pomodoro_app/models/pomodoro_state.dart';
2026-02-21 20:40:33 +01:00
/// Provides consistent theming for the Pomodoro app across platforms.
abstract final class PomodoroTheme {
2026-02-21 20:40:33 +01:00
// Brand colors per mode.
static const Color workColor = Color(0xFFE74C3C);
static const Color shortBreakColor = Color(0xFF2ECC71);
static const Color longBreakColor = Color(0xFF3498DB);
static const Color _darkSurface = Color(0xFF1A1A2E);
static const Color _darkBackground = Color(0xFF16213E);
static const Color _textLight = Color(0xFFF5F5F5);
static const Color _textMuted = Color(0xFFB0B0B0);
/// Returns the accent color for the given [mode].
static Color colorForMode(PomodoroMode mode) {
switch (mode) {
case PomodoroMode.work:
return workColor;
case PomodoroMode.shortBreak:
return shortBreakColor;
case PomodoroMode.longBreak:
return longBreakColor;
}
}
/// The app's dark theme.
static ThemeData get darkTheme => ThemeData(
2026-02-21 20:40:33 +01:00
useMaterial3: true,
brightness: Brightness.dark,
scaffoldBackgroundColor: _darkBackground,
colorScheme: const ColorScheme.dark(
primary: workColor,
surface: _darkSurface,
onSurface: _textLight,
),
textTheme: const TextTheme(
displayLarge: TextStyle(
fontSize: 72,
fontWeight: FontWeight.w300,
color: _textLight,
letterSpacing: 4,
),
headlineMedium: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: _textLight,
),
bodyLarge: TextStyle(
fontSize: 16,
color: _textMuted,
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
textStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
);
}