feat(apps/home): 新增 HomeScreen 录音交互与导航组件

This commit is contained in:
zl-q
2026-03-19 00:51:52 +08:00
parent 14ccf2cb28
commit 039e8b73d6
13 changed files with 1840 additions and 847 deletions
@@ -0,0 +1,37 @@
import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';
import '../../../../core/router/app_routes.dart';
enum HomeReturnAction { pop, goHome }
HomeReturnAction resolveHomeReturnAction({
required bool canPop,
required bool isAuthEntry,
}) {
if (isAuthEntry) {
return HomeReturnAction.goHome;
}
if (canPop) {
return HomeReturnAction.pop;
}
return HomeReturnAction.goHome;
}
void returnToHomePreserveState(
BuildContext context, {
bool isAuthEntry = false,
}) {
final action = resolveHomeReturnAction(
canPop: context.canPop(),
isAuthEntry: isAuthEntry,
);
switch (action) {
case HomeReturnAction.pop:
context.pop();
return;
case HomeReturnAction.goHome:
context.go(AppRoutes.homeMain);
return;
}
}