142 lines
5.0 KiB
Dart
142 lines
5.0 KiB
Dart
/// 时间: 2025-03-21
|
||
/// 功能: 应用配置文件
|
||
/// 介绍: 包含应用的所有配置常量,包括响应式布局、主题、API等配置
|
||
/// 最新变化: 从根目录config移动到lib/config目录
|
||
|
||
class AppConfig {
|
||
// 应用基础配置
|
||
static const String appName = '情景诗词';
|
||
static const String appVersion = '1.3.1';
|
||
static const String appDescription = 'A new Flutter project';
|
||
static const int appVersionCode = 26033101;
|
||
|
||
// 响应式布局断点
|
||
static const double mobileBreakpoint = 768.0;
|
||
static const double tabletBreakpoint = 1024.0;
|
||
static const double desktopBreakpoint = 1440.0;
|
||
|
||
// 容器配置
|
||
static const double containerMaxWidth = 1200.0;
|
||
static const double containerPadding = 16.0;
|
||
static const double containerPaddingTablet = 24.0;
|
||
static const double containerPaddingDesktop = 32.0;
|
||
|
||
// 网格配置
|
||
static const double gridSpacing = 16.0;
|
||
static const double gridSpacingTablet = 20.0;
|
||
static const double gridSpacingDesktop = 24.0;
|
||
|
||
// 分屏适配
|
||
static const double minScreenWidth = 320.0;
|
||
static const double minScreenHeight = 480.0;
|
||
static const double splitScreenMinWidth = 600.0;
|
||
|
||
// 小窗适配
|
||
static const double popupWindowMinWidth = 400.0;
|
||
static const double popupWindowMinHeight = 600.0;
|
||
static const double popupWindowMaxWidth = 800.0;
|
||
static const double popupWindowMaxHeight = 1200.0;
|
||
|
||
// 横屏适配
|
||
static const double landscapeMinHeight = 400.0;
|
||
static const double landscapeAppBarHeight = 56.0;
|
||
static const double landscapeBottomNavHeight = 56.0;
|
||
|
||
// API 配置
|
||
static const String baseUrl = 'https://api.example.com';
|
||
static const Duration apiTimeout = Duration(seconds: 30);
|
||
|
||
// 主题配置
|
||
static const String primaryColor = '#6200EE';
|
||
static const String secondaryColor = '#03DAC6';
|
||
static const String backgroundColor = '#FFFFFF';
|
||
static const String surfaceColor = '#FFFFFF';
|
||
|
||
// 圆角配置
|
||
static const double borderRadiusSmall = 4.0;
|
||
static const double borderRadiusMedium = 8.0;
|
||
static const double borderRadiusLarge = 16.0;
|
||
static const double borderRadiusMobile = 8.0;
|
||
static const double borderRadiusTablet = 12.0;
|
||
static const double borderRadiusDesktop = 16.0;
|
||
|
||
// 间距配置
|
||
static const double spacingSmall = 8.0;
|
||
static const double spacingMedium = 16.0;
|
||
static const double spacingLarge = 24.0;
|
||
static const double spacingExtraLarge = 32.0;
|
||
static const double spacingMobile = 12.0;
|
||
static const double spacingTablet = 16.0;
|
||
static const double spacingDesktop = 24.0;
|
||
|
||
// 字体大小配置
|
||
static const double fontSizeSmall = 12.0;
|
||
static const double fontSizeMedium = 14.0;
|
||
static const double fontSizeLarge = 16.0;
|
||
static const double fontSizeExtraLarge = 18.0;
|
||
static const double fontSizeTitle = 20.0;
|
||
static const double fontSizeHeading = 24.0;
|
||
|
||
// 响应式字体大小
|
||
static const double fontSizeMobile = 14.0;
|
||
static const double fontSizeTablet = 15.0;
|
||
static const double fontSizeDesktop = 16.0;
|
||
static const double fontSizeLargeDesktop = 17.0;
|
||
|
||
// 图标大小配置
|
||
static const double iconSizeSmall = 16.0;
|
||
static const double iconSizeMedium = 24.0;
|
||
static const double iconSizeLarge = 32.0;
|
||
static const double iconSizeExtraLarge = 48.0;
|
||
|
||
// 响应式图标大小
|
||
static const double iconSizeMobile = 20.0;
|
||
static const double iconSizeTablet = 24.0;
|
||
static const double iconSizeDesktop = 28.0;
|
||
static const double iconSizeLargeDesktop = 32.0;
|
||
|
||
// 按钮配置
|
||
static const double buttonHeightSmall = 36.0;
|
||
static const double buttonHeightMedium = 44.0;
|
||
static const double buttonHeightLarge = 52.0;
|
||
static const double buttonHeightMobile = 44.0;
|
||
static const double buttonHeightTablet = 48.0;
|
||
static const double buttonHeightDesktop = 52.0;
|
||
|
||
// 卡片配置
|
||
static const double cardElevation = 2.0;
|
||
static const double cardElevationMobile = 1.0;
|
||
static const double cardElevationTablet = 2.0;
|
||
static const double cardElevationDesktop = 4.0;
|
||
|
||
// 动画配置
|
||
static const Duration animationDurationShort = Duration(milliseconds: 200);
|
||
static const Duration animationDurationMedium = Duration(milliseconds: 300);
|
||
static const Duration animationDurationLong = Duration(milliseconds: 500);
|
||
|
||
// 网络配置
|
||
static const int maxRetryAttempts = 3;
|
||
static const Duration retryDelay = Duration(seconds: 2);
|
||
|
||
// 缓存配置
|
||
static const Duration cacheExpiration = Duration(hours: 24);
|
||
static const int maxCacheSize = 100; // MB
|
||
|
||
// 分页配置
|
||
static const int defaultPageSize = 20;
|
||
static const int maxPageSize = 100;
|
||
|
||
// 响应式分页配置
|
||
static const int pageSizeMobile = 10;
|
||
static const int pageSizeTablet = 15;
|
||
static const int pageSizeDesktop = 20;
|
||
static const int pageSizeLargeDesktop = 25;
|
||
|
||
// 启动配置
|
||
static const String keyFirstLaunch = 'first_launch';
|
||
static const String keyAgreementAccepted = 'agreement_accepted';
|
||
static const String keyShowGuideOnStartup = 'show_guide_on_startup';
|
||
static const String keyUserPlanJoined = 'user_plan_joined';
|
||
static const String keyAppVersion = 'app_version';
|
||
}
|