rtc_prd/airhub_app/lib/main.dart
seaislee1209 f9666d4aa3 feat: UI规范化 + 故事吸入动画 + 音乐页面优化
- 全局字体统一(Outfit/DM Sans), 头部/按钮/Toast规范化
- 故事详情页: Genie Suck吸入动画(标题+卡片一起缩小模糊消失)
- 书架页: bookPop弹出+粒子效果(三段式动画完整链路)
- 音乐页面: 心情卡片emoji换Material图标+彩色圆块横排布局
- 音乐页面: 进度条胶囊宽度对齐, 播放按钮位置修复, 间距均匀化
- 音乐播放: 接入just_audio, 支持播放暂停进度拖拽自动切歌
- 新增: iOS风格毛玻璃Toast, 渐变背景组件, 通知页面
- 阶段总结文档更新

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 19:34:53 +08:00

57 lines
1.9 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'core/router/app_router.dart';
import 'theme/app_theme.dart';
void main() {
runApp(const ProviderScope(child: AirhubApp()));
}
class AirhubApp extends ConsumerWidget {
const AirhubApp({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final router = ref.watch(goRouterProvider);
return MaterialApp.router(
routerConfig: router,
title: 'Airhub',
debugShowCheckedModeBanner: false,
theme: AppTheme.lightTheme,
locale: const Locale('zh', 'CN'),
supportedLocales: const [
Locale('zh', 'CN'),
Locale('en', 'US'),
],
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
// Web 调试时模拟 iPhone 安全区域(刘海 + 底部 Home 条)
// 真机上此代码不生效kIsWeb 在真机编译时为 false
builder: kIsWeb
? (context, child) {
// 模拟 iPhone 12 Pro 安全区: top=47px, bottom=34px
const simTop = 47.0;
const simBottom = 34.0;
final mq = MediaQuery.of(context);
return MediaQuery(
data: mq.copyWith(
padding: mq.padding.copyWith(
top: mq.padding.top < simTop ? simTop : mq.padding.top,
bottom: mq.padding.bottom < simBottom
? simBottom
: mq.padding.bottom,
),
),
child: child ?? const SizedBox.shrink(),
);
}
: null,
);
}
}