- Nunito font replacing Plus Jakarta Sans - SButton: Stack-based 3D pressable (dark shadow layer + top layer translates on press) - SCard: flat border-based selection, no shadows - SProgressBar: 4px thin bar, animated fill - All screens: white bg, no gradients - Duolingo layout: illustration top zone, content below, sticky button
67 lines
2.3 KiB
Dart
67 lines
2.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
class SColors {
|
|
// Backgrounds
|
|
static const bgPage = Color(0xFFFAFAFE);
|
|
static const bgSurface = Color(0xFFFFFFFF);
|
|
|
|
// Primary (Indigo)
|
|
static const primary = Color(0xFF5B4FCF);
|
|
static const primaryDark = Color(0xFF3D32A8); // button bottom border
|
|
static const primaryLight = Color(0xFFEAE7FB); // selected card tint
|
|
static const primaryBorder = Color(0xFF5B4FCF); // selected card border
|
|
|
|
// Text
|
|
static const textHead = Color(0xFF1C1A2E);
|
|
static const textBody = Color(0xFF4B4B6B);
|
|
static const textSub = Color(0xFF9898AA);
|
|
static const textDisabled = Color(0xFFC4C4D4);
|
|
|
|
// Borders
|
|
static const borderLight = Color(0xFFE8E6F0);
|
|
static const borderMedium = Color(0xFFD0CDEA);
|
|
|
|
// Accent
|
|
static const accent = Color(0xFFFF7EB3);
|
|
static const accentLight = Color(0xFFFFF0F6);
|
|
|
|
// States
|
|
static const success = Color(0xFF4CAF50);
|
|
static const error = Color(0xFFFF4B4B);
|
|
}
|
|
|
|
TextStyle _nunito(double size, FontWeight weight, Color color, {double? height, double? letterSpacing}) {
|
|
return GoogleFonts.nunito(
|
|
fontSize: size,
|
|
fontWeight: weight,
|
|
color: color,
|
|
height: height,
|
|
letterSpacing: letterSpacing,
|
|
);
|
|
}
|
|
|
|
class SText {
|
|
static TextStyle headline1(Color c) => _nunito(36, FontWeight.w900, c, height: 1.15);
|
|
static TextStyle headline2(Color c) => _nunito(26, FontWeight.w800, c, height: 1.2);
|
|
static TextStyle title(Color c) => _nunito(22, FontWeight.w800, c, height: 1.25);
|
|
static TextStyle subtitle(Color c) => _nunito(15, FontWeight.w600, c, height: 1.5);
|
|
static TextStyle body(Color c) => _nunito(15, FontWeight.w600, c, height: 1.5);
|
|
static TextStyle caption(Color c) => _nunito(12, FontWeight.w500, c, height: 1.4);
|
|
static TextStyle button(Color c) => _nunito(15, FontWeight.w800, c, letterSpacing: 0.3);
|
|
static TextStyle cardLabel(Color c) => _nunito(16, FontWeight.w700, c);
|
|
static TextStyle cardSub(Color c) => _nunito(13, FontWeight.w500, c);
|
|
}
|
|
|
|
ThemeData buildTheme() {
|
|
return ThemeData(
|
|
colorScheme: const ColorScheme.light(
|
|
primary: SColors.primary,
|
|
surface: SColors.bgSurface,
|
|
),
|
|
scaffoldBackgroundColor: SColors.bgPage,
|
|
textTheme: GoogleFonts.nunitoTextTheme(),
|
|
useMaterial3: true,
|
|
);
|
|
}
|