165 lines
5.5 KiB
Dart
165 lines
5.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Toss-inspired palette (unofficial — evokes clean fintech / super-app UI).
|
|
abstract final class TossColors {
|
|
static const Color blue = Color(0xFF3182F6);
|
|
static const Color blueDark = Color(0xFF1B64DA);
|
|
static const Color bg = Color(0xFFF2F4F6);
|
|
static const Color surface = Color(0xFFFFFFFF);
|
|
static const Color textPrimary = Color(0xFF191F28);
|
|
static const Color textSecondary = Color(0xFF8B95A1);
|
|
static const Color line = Color(0xFFE5E8EB);
|
|
static const Color inputFill = Color(0xFFF2F4F6);
|
|
}
|
|
|
|
/// Global theme: light, high whitespace, blue CTAs.
|
|
ThemeData buildTossTheme() {
|
|
const primary = TossColors.blue;
|
|
const colorScheme = ColorScheme.light(
|
|
primary: primary,
|
|
onPrimary: Colors.white,
|
|
primaryContainer: Color(0xFFE8F3FF),
|
|
onPrimaryContainer: TossColors.blueDark,
|
|
surface: TossColors.surface,
|
|
onSurface: TossColors.textPrimary,
|
|
onSurfaceVariant: TossColors.textSecondary,
|
|
outline: TossColors.line,
|
|
error: Color(0xFFF04452),
|
|
onError: Colors.white,
|
|
);
|
|
|
|
final base = ThemeData.light();
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
colorScheme: colorScheme,
|
|
scaffoldBackgroundColor: TossColors.bg,
|
|
splashFactory: InkRipple.splashFactory,
|
|
textTheme: base.textTheme.copyWith(
|
|
headlineLarge: const TextStyle(
|
|
fontSize: 28,
|
|
fontWeight: FontWeight.w700,
|
|
height: 1.25,
|
|
letterSpacing: -0.5,
|
|
color: TossColors.textPrimary,
|
|
),
|
|
headlineMedium: const TextStyle(
|
|
fontSize: 22,
|
|
fontWeight: FontWeight.w700,
|
|
height: 1.3,
|
|
color: TossColors.textPrimary,
|
|
),
|
|
titleLarge: const TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w700,
|
|
color: TossColors.textPrimary,
|
|
),
|
|
titleMedium: const TextStyle(
|
|
fontSize: 17,
|
|
fontWeight: FontWeight.w600,
|
|
color: TossColors.textPrimary,
|
|
),
|
|
titleSmall: const TextStyle(
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w600,
|
|
color: TossColors.textPrimary,
|
|
),
|
|
bodyLarge: const TextStyle(
|
|
fontSize: 16,
|
|
height: 1.45,
|
|
color: TossColors.textPrimary,
|
|
),
|
|
bodyMedium: const TextStyle(
|
|
fontSize: 15,
|
|
height: 1.45,
|
|
color: TossColors.textSecondary,
|
|
),
|
|
bodySmall: const TextStyle(
|
|
fontSize: 13,
|
|
height: 1.4,
|
|
color: TossColors.textSecondary,
|
|
),
|
|
labelLarge: const TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w600,
|
|
color: TossColors.textPrimary,
|
|
),
|
|
),
|
|
appBarTheme: const AppBarTheme(
|
|
elevation: 0,
|
|
scrolledUnderElevation: 0,
|
|
centerTitle: false,
|
|
backgroundColor: TossColors.surface,
|
|
foregroundColor: TossColors.textPrimary,
|
|
titleTextStyle: TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w700,
|
|
color: TossColors.textPrimary,
|
|
),
|
|
iconTheme: IconThemeData(color: TossColors.textPrimary, size: 22),
|
|
),
|
|
cardTheme: CardThemeData(
|
|
color: TossColors.surface,
|
|
elevation: 0,
|
|
shadowColor: Colors.black.withValues(alpha: 0.06),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
margin: EdgeInsets.zero,
|
|
),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: TossColors.inputFill,
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
hintStyle: const TextStyle(color: TossColors.textSecondary, fontSize: 16),
|
|
labelStyle: const TextStyle(color: TossColors.textSecondary, fontSize: 14),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(14),
|
|
borderSide: BorderSide.none,
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(14),
|
|
borderSide: BorderSide.none,
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(14),
|
|
borderSide: const BorderSide(color: TossColors.blue, width: 1.5),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(14),
|
|
borderSide: BorderSide(color: colorScheme.error.withValues(alpha: 0.8)),
|
|
),
|
|
),
|
|
filledButtonTheme: FilledButtonThemeData(
|
|
style: FilledButton.styleFrom(
|
|
backgroundColor: primary,
|
|
foregroundColor: Colors.white,
|
|
disabledBackgroundColor: TossColors.line,
|
|
disabledForegroundColor: TossColors.textSecondary,
|
|
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 24),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
|
textStyle: const TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
|
elevation: 0,
|
|
),
|
|
),
|
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
style: OutlinedButton.styleFrom(
|
|
foregroundColor: primary,
|
|
side: const BorderSide(color: TossColors.line),
|
|
padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 20),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
|
),
|
|
),
|
|
textButtonTheme: TextButtonThemeData(
|
|
style: TextButton.styleFrom(
|
|
foregroundColor: TossColors.textSecondary,
|
|
textStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.w500),
|
|
),
|
|
),
|
|
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
|
backgroundColor: TossColors.blue,
|
|
foregroundColor: Colors.white,
|
|
elevation: 2,
|
|
shape: CircleBorder(),
|
|
),
|
|
dividerTheme: const DividerThemeData(color: TossColors.line, thickness: 1),
|
|
);
|
|
}
|