fix:按html的假数据demo

This commit is contained in:
jingyun
2026-06-05 11:12:55 +08:00
parent b4272b5ec9
commit 9727b906c6
28 changed files with 2159 additions and 711 deletions
+63 -61
View File
@@ -1,98 +1,100 @@
import 'package:flutter/material.dart';
import 'yanting_text.dart';
import 'yanting_tokens.dart';
import 'wise_tokens.dart';
ThemeData buildAppTheme() {
final scheme = ColorScheme.fromSeed(
seedColor: WiseColors.primary,
primary: WiseColors.primary,
secondary: WiseColors.secondary,
tertiary: WiseColors.accent,
surface: WiseColors.surface,
seedColor: YantingColors.primary,
primary: YantingColors.primary,
onPrimary: YantingColors.primaryForeground,
secondary: YantingColors.secondary,
onSecondary: YantingColors.secondaryForeground,
tertiary: YantingColors.link,
surface: YantingColors.card,
onSurface: YantingColors.foreground,
error: YantingColors.destructive,
outline: YantingColors.border,
);
return ThemeData(
useMaterial3: true,
colorScheme: scheme,
fontFamily: 'Inter',
scaffoldBackgroundColor: WiseColors.canvas,
fontFamily: YantingText.fontFamily,
fontFamilyFallback: YantingText.fontFallback,
scaffoldBackgroundColor: YantingColors.background,
appBarTheme: const AppBarTheme(
backgroundColor: WiseColors.canvas,
foregroundColor: WiseColors.primary,
backgroundColor: YantingColors.background,
foregroundColor: YantingColors.foreground,
elevation: 0,
centerTitle: false,
titleTextStyle: TextStyle(
color: WiseColors.primary,
fontSize: 22,
fontWeight: FontWeight.w800,
),
titleTextStyle: YantingText.sectionTitle,
),
cardTheme: const CardThemeData(
color: WiseColors.surface,
color: YantingColors.card,
elevation: 0,
margin: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(WiseRadius.md)),
side: BorderSide(color: YantingColors.border),
),
),
dividerTheme: const DividerThemeData(
color: YantingColors.border,
thickness: 1,
space: 1,
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: YantingColors.background,
hintStyle: YantingText.body.copyWith(
color: YantingColors.mutedForeground,
),
contentPadding: const EdgeInsets.symmetric(horizontal: 14),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(YantingRadius.md),
borderSide: const BorderSide(color: YantingColors.input),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(YantingRadius.md),
borderSide: const BorderSide(color: YantingColors.input),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(YantingRadius.md),
borderSide: const BorderSide(color: YantingColors.foreground),
),
),
navigationBarTheme: NavigationBarThemeData(
backgroundColor: WiseColors.surface,
indicatorColor: WiseColors.secondary200,
backgroundColor: YantingColors.background,
indicatorColor: Colors.transparent,
labelTextStyle: WidgetStateProperty.resolveWith(
(states) => TextStyle(
(states) => YantingText.meta.copyWith(
color: states.contains(WidgetState.selected)
? WiseColors.primary
: WiseColors.textTertiary,
? YantingColors.foreground
: YantingColors.mutedForeground,
fontSize: 11,
fontWeight: FontWeight.w700,
fontWeight: states.contains(WidgetState.selected)
? FontWeight.w600
: FontWeight.w400,
),
),
iconTheme: WidgetStateProperty.resolveWith(
(states) => IconThemeData(
color: states.contains(WidgetState.selected)
? WiseColors.primary
: WiseColors.textTertiary,
? YantingColors.foreground
: YantingColors.mutedForeground,
),
),
),
textTheme: const TextTheme(
headlineSmall: TextStyle(
color: WiseColors.ink,
fontSize: 26,
height: 1.18,
fontWeight: FontWeight.w800,
),
titleLarge: TextStyle(
color: WiseColors.ink,
fontSize: 21,
height: 1.22,
fontWeight: FontWeight.w800,
),
titleMedium: TextStyle(
color: WiseColors.ink,
fontSize: 17,
height: 1.25,
fontWeight: FontWeight.w800,
),
bodyLarge: TextStyle(
color: WiseColors.ink,
fontSize: 16,
height: 1.55,
),
bodyMedium: TextStyle(
color: WiseColors.ink700,
fontSize: 14,
height: 1.5,
),
bodySmall: TextStyle(
color: WiseColors.textSecondary,
fontSize: 12,
height: 1.45,
),
labelSmall: TextStyle(
color: WiseColors.textSecondary,
fontSize: 11,
fontWeight: FontWeight.w700,
),
headlineSmall: YantingText.appTitle,
titleLarge: YantingText.sectionTitle,
titleMedium: YantingText.cardTitle,
bodyLarge: YantingText.body,
bodyMedium: YantingText.sub,
bodySmall: YantingText.meta,
labelLarge: YantingText.chip,
labelSmall: YantingText.badge,
),
);
}