fix(ui): preserve mobile home route and confirm Android exit (#1507)

This commit is contained in:
Levi authored and GitHub committed 2026-09-12 21:44:27 +08:00
1 parent 46675f26af
commit 8fa9a1e902
10 files changed
+484 -96

No files matched your search

@@ -0,0 +1,30 @@
import 'package:shadcn_flutter/shadcn_flutter.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../application/app_runtime_controller.dart';
import '../../l10n/l10n.dart';
/// Gates page content without unmounting the Navigator during startup.
class RuntimePage extends ConsumerWidget {
const RuntimePage({super.key, required this.builder});
final WidgetBuilder builder;
@override
Widget build(BuildContext context, WidgetRef ref) {
return ref
.watch(appRuntimeControllerProvider)
.when(
loading: () => const Scaffold(child: Center(child: CircularProgressIndicator())),
error: (error, _) => Scaffold(
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 420),
child: Text(context.l10n.runtimeInitializationFailed(error.toString()), textAlign: TextAlign.center),
),
),
),
data: (_) => builder(context),
);
}
}