feat(android): 支持沉浸式状态栏、地图定位与自定义签名
- 配置 edge-to-edge 沉浸式状态栏与刘海屏适配 - 新增百度地图权限、AK 配置及定位权限说明 - 接入 MethodChannel 实现返回键退后台热启动优化 - 配置自定义签名并更新构建逻辑 - 完善 token 刷新与鉴权失效统一处理 - 新增地图页与截图页路由 - 修复返回键拦截导致的 PopScope 失效问题
This commit is contained in:
1 parent
41d815336a
commit
06cdc77172
51 files changed
+3988
-634
No files matched your search
@@ -77,9 +77,15 @@ class _ForgotPasswordPageState extends ConsumerState<ForgotPasswordPage> {
|
||||
final l10n = AppLocalizations.of(context);
|
||||
|
||||
return PopScope(
|
||||
canPop: true,
|
||||
// 拦截系统返回键:优先出栈;若无法出栈则跳回登录页。
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, _) {
|
||||
if (!didPop) context.pop();
|
||||
if (didPop) return;
|
||||
if (context.canPop()) {
|
||||
context.pop();
|
||||
} else {
|
||||
context.go('/login');
|
||||
}
|
||||
},
|
||||
child: CupertinoPageScaffold(
|
||||
backgroundColor: CupertinoColors.systemGroupedBackground,
|
||||
@@ -168,13 +174,13 @@ class _ForgotPasswordPageState extends ConsumerState<ForgotPasswordPage> {
|
||||
' title=${l10n.alertTitle} message=$message');
|
||||
showCupertinoDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => CupertinoAlertDialog(
|
||||
builder: (dialogContext) => CupertinoAlertDialog(
|
||||
title: Text(l10n.alertTitle),
|
||||
content: Text(message),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(l10n.confirm),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
onPressed: () => Navigator.of(dialogContext).pop(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/gestures.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../../core/utils/system_ui_util.dart';
|
||||
import '../../../app/theme/app_theme.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import '../domain/auth_models.dart';
|
||||
@@ -50,18 +51,18 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
' title=${l10n.exitConfirmTitle} content=${l10n.exitConfirmContent}');
|
||||
return showCupertinoDialog<bool>(
|
||||
context: context,
|
||||
builder: (_) => CupertinoAlertDialog(
|
||||
builder: (dialogContext) => CupertinoAlertDialog(
|
||||
title: Text(l10n.exitConfirmTitle),
|
||||
content: Text(l10n.exitConfirmContent),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(l10n.cancel),
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
onPressed: () => Navigator.of(dialogContext).pop(false),
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
isDestructiveAction: true,
|
||||
child: Text(l10n.exitApp),
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
onPressed: () => Navigator.of(dialogContext).pop(true),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -88,13 +89,13 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
' title=${l10n.alertTitle} message=$message');
|
||||
showCupertinoDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => CupertinoAlertDialog(
|
||||
builder: (dialogContext) => CupertinoAlertDialog(
|
||||
title: Text(l10n.alertTitle),
|
||||
content: Text(message),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(l10n.confirm),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
onPressed: () => Navigator.of(dialogContext).pop(),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -122,7 +123,10 @@ class _LoginPageState extends ConsumerState<LoginPage> {
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, _) async {
|
||||
if (didPop) return;
|
||||
await _onWillPop();
|
||||
final shouldExit = await _showExitConfirm();
|
||||
if (shouldExit == true) {
|
||||
await SystemUiUtil.moveToBack();
|
||||
}
|
||||
},
|
||||
child: CupertinoPageScaffold(
|
||||
backgroundColor: CupertinoColors.white,
|
||||
|
||||
@@ -52,9 +52,15 @@ class _RegisterPageState extends ConsumerState<RegisterPage> {
|
||||
final l10n = AppLocalizations.of(context);
|
||||
|
||||
return PopScope(
|
||||
canPop: true,
|
||||
// 拦截系统返回键:优先出栈;若无法出栈则跳回登录页。
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, _) {
|
||||
if (!didPop) context.pop();
|
||||
if (didPop) return;
|
||||
if (context.canPop()) {
|
||||
context.pop();
|
||||
} else {
|
||||
context.go('/login');
|
||||
}
|
||||
},
|
||||
child: CupertinoPageScaffold(
|
||||
backgroundColor: CupertinoColors.systemGroupedBackground,
|
||||
@@ -144,13 +150,13 @@ class _RegisterPageState extends ConsumerState<RegisterPage> {
|
||||
' title=${l10n.alertTitle} message=$message');
|
||||
showCupertinoDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => CupertinoAlertDialog(
|
||||
builder: (dialogContext) => CupertinoAlertDialog(
|
||||
title: Text(l10n.alertTitle),
|
||||
content: Text(message),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(l10n.confirm),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
onPressed: () => Navigator.of(dialogContext).pop(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user