feat(app): 初始化 Flutter 前端项目 (Phase F0)
- Flutter 3.44.0 + Dart 3.12.0 - 设计系统: 7色Token×浅/深模式, NotoSansSC/Caveat字体, 圆角10/16/22/28/pill, 三级阴影 - ResponsiveScaffold: 手机底部TabBar / 平板侧边Rail / 桌面三栏 - go_router 路由表: 13个页面 (5个Tab + 8个全屏页面) - 13个功能模块占位页面 (home/calendar/mood/search/profile/editor/auth/class/teacher/parent/achievement/stickers/templates) - 依赖: flutter_bloc, go_router, freezed, isar, dio, perfect_freehand, fl_chart - 中国镜像: PUB_HOSTED_URL + FLUTTER_STORAGE_BASE_URL - flutter analyze: No issues found
This commit is contained in:
24
app/lib/core/constants/breakpoints.dart
Normal file
24
app/lib/core/constants/breakpoints.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
// 暖记响应式断点
|
||||
// 手机 < 600 | 平板 600-1024 | 桌面 > 1024
|
||||
|
||||
class Breakpoints {
|
||||
Breakpoints._();
|
||||
|
||||
/// 手机最大宽度
|
||||
static const double mobile = 600;
|
||||
|
||||
/// 平板最大宽度
|
||||
static const double tablet = 1024;
|
||||
|
||||
/// 触摸目标最小尺寸 (WCAG + Apple HIG)
|
||||
static const double touchTarget = 44;
|
||||
|
||||
/// 判断设备类型
|
||||
static DeviceType getDeviceType(double width) {
|
||||
if (width < mobile) return DeviceType.mobile;
|
||||
if (width < tablet) return DeviceType.tablet;
|
||||
return DeviceType.desktop;
|
||||
}
|
||||
}
|
||||
|
||||
enum DeviceType { mobile, tablet, desktop }
|
||||
41
app/lib/core/constants/design_tokens.dart
Normal file
41
app/lib/core/constants/design_tokens.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
// 暖记设计常量 — 间距 / 动画 / 触摸目标
|
||||
|
||||
import 'package:flutter/animation.dart';
|
||||
|
||||
class DesignTokens {
|
||||
DesignTokens._();
|
||||
|
||||
// ===== 间距 =====
|
||||
static const double spacing4 = 4;
|
||||
static const double spacing8 = 8;
|
||||
static const double spacing12 = 12;
|
||||
static const double spacing16 = 16;
|
||||
static const double spacing20 = 20;
|
||||
static const double spacing24 = 24;
|
||||
static const double spacing32 = 32;
|
||||
static const double spacing48 = 48;
|
||||
|
||||
// ===== 动画时长 =====
|
||||
static const Duration animFast = Duration(milliseconds: 150);
|
||||
static const Duration animNormal = Duration(milliseconds: 300);
|
||||
static const Duration animSlow = Duration(milliseconds: 500);
|
||||
|
||||
// ===== 弹性曲线 cubic-bezier(0.34, 1.56, 0.64, 1) =====
|
||||
static const Curve warmCurve = Curves.easeOutBack;
|
||||
|
||||
// ===== 列表/网格 =====
|
||||
static const int journalGridCrossAxisCountMobile = 2;
|
||||
static const int journalGridCrossAxisCountTablet = 3;
|
||||
static const int journalGridCrossAxisCountDesktop = 4;
|
||||
|
||||
// ===== 日记限制 =====
|
||||
static const int maxTagsPerJournal = 10;
|
||||
static const int maxTitleLength = 100;
|
||||
static const int maxStrokesPerElement = 5000;
|
||||
static const int maxUndoSteps = 50;
|
||||
|
||||
// ===== 班级码 =====
|
||||
static const int classCodeLength = 6;
|
||||
static const int classCodeMaxAttempts = 5;
|
||||
static const int classCodeLockoutMinutes = 30;
|
||||
}
|
||||
Reference in New Issue
Block a user