Files
photo-live/apps/mobile/lib/pages/home_page.dart
T
浅念 8bc50e07ef feat(mobile): flutter scaffold with env script and baseline nav
- scripts/flutter-env.sh: toolchain PATH/JAVA_HOME/ANDROID_HOME + pub 镜像 env
- apps/mobile: flutter create (com.photolive.photo_live, android+ios)
  - Android minSdk 24 / targetSdk 36;INTERNET 权限(main manifest,debug+release)
  - iOS Info.plist:本地网络 ATS 例外 + 相册/相机用途说明(zh+en)
- 依赖接入:riverpod / drift(+sqlite3_flutter_libs) / dio / secure_storage /
  image_picker / camera / qr_flutter / path_provider / path / intl
- l10n:l10n.yaml + app_zh/app_en arb(20 键),gen-l10n(zh 模板,非空 getter)
- 基线:Material 3 主题、/login→/home 命名路由、底部导航(相册/队列/设置桩)、
  locale provider 脚手架(Task 10 完成切换)
- flutter analyze 零问题;widget 测试通过;debug apk 构建成功
  (MuMu 冒烟因宿主 commit 内存耗尽未完成,Task 2 重试)

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-19 00:22:04 +08:00

113 lines
3.0 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/material.dart';
import '../l10n/app_localizations.dart';
/// 主壳:底部导航(相册 / 队列 / 设置)。
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
int _selectedIndex = 0;
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
return Scaffold(
body: IndexedStack(
index: _selectedIndex,
children: const [
AlbumsTab(),
QueueTab(),
SettingsTab(),
],
),
bottomNavigationBar: NavigationBar(
selectedIndex: _selectedIndex,
onDestinationSelected: (index) =>
setState(() => _selectedIndex = index),
destinations: [
NavigationDestination(
icon: const Icon(Icons.photo_library_outlined),
selectedIcon: const Icon(Icons.photo_library),
label: l10n.homeTabAlbums,
),
NavigationDestination(
icon: const Icon(Icons.cloud_upload_outlined),
selectedIcon: const Icon(Icons.cloud_upload),
label: l10n.homeTabQueue,
),
NavigationDestination(
icon: const Icon(Icons.settings_outlined),
selectedIcon: const Icon(Icons.settings),
label: l10n.homeTabSettings,
),
],
),
);
}
}
/// 相册列表(桩)。Task 4:游标分页、创建/编辑、二维码分享。
class AlbumsTab extends StatelessWidget {
const AlbumsTab({super.key});
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
return Scaffold(
appBar: AppBar(title: Text(l10n.albums)),
body: Center(
child: Text(
l10n.albums,
style: Theme.of(context).textTheme.headlineSmall,
),
),
);
}
}
/// 上传队列(桩)。Task 6/9:状态机展示、筛选与重试。
class QueueTab extends StatelessWidget {
const QueueTab({super.key});
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
return Scaffold(
appBar: AppBar(title: Text(l10n.queue)),
body: Center(
child: Text(
l10n.queue,
style: Theme.of(context).textTheme.headlineSmall,
),
),
);
}
}
/// 设置(桩)。Task 10:App 内语言切换(zh / en / 跟随系统)持久化。
class SettingsTab extends StatelessWidget {
const SettingsTab({super.key});
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
return Scaffold(
appBar: AppBar(title: Text(l10n.settings)),
body: ListView(
children: [
ListTile(
leading: const Icon(Icons.language),
title: Text(l10n.language),
subtitle: Text(l10n.localeFollowSystem),
),
],
),
);
}
}