feat: 实现导航页基础功能
- 添加导航条目和分类数据模型 - 实现导航卡片网格展示 - 支持点击卡片打开链接 - 添加主题样式(渐变色、卡片阴影) - 区分系统默认和自定义条目 - 添加分类统计信息"
This commit is contained in:
54
frontend/lib/theme/app_theme.dart
Normal file
54
frontend/lib/theme/app_theme.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppTheme {
|
||||
// 颜色方案
|
||||
static const Color primaryColor = Color(0xFF2563EB);
|
||||
static const Color secondaryColor = Color(0xFF7C3AED);
|
||||
static const Color backgroundColor = Color(0xFFF8FAFC);
|
||||
static const Color cardColor = Colors.white;
|
||||
static const Color systemTagColor = Color(0xFFE2E8F0);
|
||||
static const Color systemTagTextColor = Color(0xFF64748B);
|
||||
|
||||
// 渐变背景
|
||||
static final LinearGradient appBarGradient = LinearGradient(
|
||||
colors: [primaryColor, secondaryColor],
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
);
|
||||
|
||||
// 卡片阴影
|
||||
static final List<BoxShadow> cardShadow = [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.1),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
];
|
||||
|
||||
// 主题数据
|
||||
static ThemeData lightTheme = ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: primaryColor,
|
||||
primary: primaryColor,
|
||||
secondary: secondaryColor,
|
||||
background: backgroundColor,
|
||||
),
|
||||
scaffoldBackgroundColor: backgroundColor,
|
||||
cardTheme: CardThemeData(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
color: cardColor,
|
||||
shadowColor: Colors.transparent,
|
||||
),
|
||||
appBarTheme: const AppBarTheme(
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user