132 lines
4.9 KiB
Dart
132 lines
4.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
class AppTheme {
|
|
// Mapan Core Tokens (Heritage Gallery)
|
|
static const Color primary = Color(0xFFE1251B);
|
|
static const Color primaryContainer = Color(0xFFBB0004);
|
|
static const Color secondary = Color(0xFFCA8342);
|
|
static const Color secondaryContainer = Color(0xFFFFBF3C);
|
|
static const Color onSecondaryContainer = Color(0xFFEADFD2);
|
|
|
|
// Surface Hierarchy
|
|
static const Color surface = Color(0xFFFFF8F3);
|
|
static const Color surfaceContainer = Color(0xFFF7ECDF);
|
|
static const Color surfaceContainerLow = Color(0xFFFDF2E5);
|
|
static const Color surfaceContainerLowest = Colors.white;
|
|
static const Color surfaceContainerHighest = Color(0xFFECE1D4);
|
|
|
|
// Text & On-Colors
|
|
static const Color onSurface = Color(0xFF201B13);
|
|
static const Color onSurfaceVariant = Color(0xFF5D3F3B);
|
|
static const Color onPrimary = Colors.white;
|
|
|
|
/// The Signature 135-degree CTA Gradient for main buttons.
|
|
static const LinearGradient primaryGradient = LinearGradient(
|
|
colors: [primary, primaryContainer],
|
|
begin: Alignment.topLeft,
|
|
end: Alignment.bottomRight, // Approximation of 135 degrees
|
|
);
|
|
|
|
static ThemeData get lightTheme {
|
|
final baseTheme = ThemeData.light();
|
|
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
scaffoldBackgroundColor: surface,
|
|
colorScheme: const ColorScheme.light(
|
|
primary: primary,
|
|
primaryContainer: primaryContainer,
|
|
secondary: secondary,
|
|
secondaryContainer: secondaryContainer,
|
|
onSecondaryContainer: onSecondaryContainer,
|
|
surface: surface,
|
|
onSurface: onSurface,
|
|
onSurfaceVariant: onSurfaceVariant,
|
|
onPrimary: onPrimary,
|
|
error: Color(0xFFBA1A1A),
|
|
),
|
|
textTheme: baseTheme.textTheme.copyWith(
|
|
displayLarge: GoogleFonts.plusJakartaSans(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.bold,
|
|
letterSpacing: -0.5,
|
|
),
|
|
displayMedium: GoogleFonts.plusJakartaSans(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
displaySmall: GoogleFonts.plusJakartaSans(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
headlineMedium: GoogleFonts.plusJakartaSans(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
titleLarge: GoogleFonts.plusJakartaSans(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleMedium: GoogleFonts.plusJakartaSans(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleSmall: GoogleFonts.plusJakartaSans(
|
|
color: onSurface,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
bodyLarge: GoogleFonts.plusJakartaSans(color: onSurfaceVariant),
|
|
bodyMedium: GoogleFonts.plusJakartaSans(color: onSurfaceVariant),
|
|
bodySmall: GoogleFonts.plusJakartaSans(color: onSurfaceVariant),
|
|
labelLarge: GoogleFonts.plusJakartaSans(color: onSurfaceVariant),
|
|
),
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
foregroundColor: onPrimary,
|
|
backgroundColor: primaryContainer, // Fallback if no gradient is used
|
|
elevation: 0,
|
|
),
|
|
),
|
|
cardTheme: CardThemeData(
|
|
color: surfaceContainerLow,
|
|
elevation: 0, // Depth created via tonal shifts
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
margin: EdgeInsets.zero,
|
|
),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: surfaceContainerLowest, // Spec: soft filled background
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
border: const UnderlineInputBorder(
|
|
borderSide: BorderSide.none, // Minimum/No outline by default
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), topRight: Radius.circular(8)),
|
|
),
|
|
enabledBorder: const UnderlineInputBorder(
|
|
borderSide: BorderSide.none,
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(8), topRight: Radius.circular(8)),
|
|
),
|
|
focusedBorder: UnderlineInputBorder(
|
|
borderSide: BorderSide(color: primary.withOpacity(0.5), width: 2),
|
|
borderRadius: const BorderRadius.only(topLeft: Radius.circular(8), topRight: Radius.circular(8)),
|
|
),
|
|
labelStyle: const TextStyle(color: onSurfaceVariant),
|
|
),
|
|
appBarTheme: AppBarTheme(
|
|
backgroundColor: surface,
|
|
foregroundColor: onSurface,
|
|
elevation: 0,
|
|
surfaceTintColor: Colors.transparent,
|
|
titleTextStyle: GoogleFonts.plusJakartaSans(
|
|
color: onSurface,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|