8bc50e07ef
- 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>
63 lines
2.0 KiB
Dart
63 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../l10n/app_localizations.dart';
|
|
|
|
/// 登录页(桩)。
|
|
///
|
|
/// Task 3 实现:真实登录、错误本地化(含 AUTH_RATE_LIMITED / 429 重试等待)、
|
|
/// 会话持久化与退出登录。
|
|
class LoginPage extends StatelessWidget {
|
|
const LoginPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context);
|
|
return Scaffold(
|
|
appBar: AppBar(title: Text(l10n.appName)),
|
|
body: Center(
|
|
child: ConstrainedBox(
|
|
constraints: const BoxConstraints(maxWidth: 420),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(24),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
TextField(
|
|
decoration: InputDecoration(
|
|
labelText: l10n.username,
|
|
border: const OutlineInputBorder(),
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
TextField(
|
|
obscureText: true,
|
|
enableSuggestions: false,
|
|
autocorrect: false,
|
|
decoration: InputDecoration(
|
|
labelText: l10n.password,
|
|
border: const OutlineInputBorder(),
|
|
),
|
|
),
|
|
const SizedBox(height: 24),
|
|
FilledButton(
|
|
// 桩:直接进入主壳;Task 3 接真实认证。
|
|
onPressed: () =>
|
|
Navigator.of(context).pushReplacementNamed('/home'),
|
|
child: Text(l10n.login),
|
|
),
|
|
const SizedBox(height: 12),
|
|
Text(
|
|
l10n.loginHint,
|
|
textAlign: TextAlign.center,
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|