feat(core): add theme, shared widgets and validators

This commit is contained in:
qzl
2026-02-25 10:52:18 +08:00
parent febd10d64e
commit 8c0b0a25c3
8 changed files with 389 additions and 2 deletions
+53
View File
@@ -0,0 +1,53 @@
import 'package:flutter/material.dart';
import 'design_tokens.dart';
class AppTheme {
AppTheme._();
static ThemeData get light => ThemeData(
useMaterial3: true,
brightness: Brightness.light,
scaffoldBackgroundColor: AppColors.background,
colorScheme: ColorScheme.fromSeed(
seedColor: AppColors.primary,
brightness: Brightness.light,
),
fontFamily: 'Inter',
appBarTheme: const AppBarTheme(
backgroundColor: AppColors.background,
foregroundColor: AppColors.slate900,
elevation: 0,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.primary,
foregroundColor: AppColors.primaryForeground,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadius.sm),
),
),
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: AppColors.background,
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(AppRadius.sm),
borderSide: const BorderSide(color: AppColors.input),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(AppRadius.sm),
borderSide: const BorderSide(color: AppColors.input),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(AppRadius.sm),
borderSide: const BorderSide(color: AppColors.input),
),
hintStyle: const TextStyle(
color: AppColors.mutedForeground,
fontSize: 14,
),
),
);
}