퀘스트 완료 햅틱 · HOME 행성 반응 · Push·라이브 띠 중복 제어 · 알림함 위계 · Push 탭 화면 이동
This commit is contained in:
+44
-2
@@ -17,7 +17,10 @@ import 'features/home/home_screen.dart' show homeRefreshSignal;
|
||||
import 'core/theme/app_theme.dart';
|
||||
import 'features/auth/auth_repository.dart';
|
||||
import 'features/campaign/campaign_detail_screen.dart';
|
||||
import 'features/eclipse/eclipse_defend_screen.dart' show eclipseDefendRoute;
|
||||
import 'features/eclipse/widgets/live_proof.dart' show liveTickerShowing;
|
||||
import 'features/notification/notification_screen.dart';
|
||||
import 'features/planet/planet_detail_screen.dart';
|
||||
import 'features/quest/quest_detail_screen.dart';
|
||||
import 'features/translation/translation_comments.dart';
|
||||
|
||||
@@ -228,7 +231,14 @@ class _FancakeAppState extends State<FancakeApp> with WidgetsBindingObserver {
|
||||
void _showInApp(PushNotice notice) {
|
||||
// 타임어택 발동 · 퀘스트 완료 등 — HOME 카드가 바로 따라오게 다시 읽힌다.
|
||||
homeRefreshSignal.value++;
|
||||
if (!notice.hasText || !shouldShowInApp(notice, _inAppShowing)) return;
|
||||
if (!notice.hasText ||
|
||||
!shouldShowInApp(
|
||||
notice,
|
||||
_inAppShowing,
|
||||
ticker: _homeOnTop ? liveTickerShowing : null,
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
final messenger = _messengerKey.currentState;
|
||||
if (messenger == null) return;
|
||||
messenger.hideCurrentSnackBar();
|
||||
@@ -260,7 +270,39 @@ class _FancakeAppState extends State<FancakeApp> with WidgetsBindingObserver {
|
||||
/// 지금 떠 있는 앱 안 알림. 닫히면 비운다.
|
||||
PushNotice? _inAppShowing;
|
||||
|
||||
void _openFromPush(PushNotice notice) => _router.go(notice.route);
|
||||
/// HOME 탭이 맨 위인가 — 루트에 덮인 화면이 없을 때만 라이브 띠가 보인다.
|
||||
bool get _homeOnTop =>
|
||||
_router.routerDelegate.currentConfiguration.uri.path == '/home' &&
|
||||
!(_router.routerDelegate.navigatorKey.currentState?.canPop() ?? false);
|
||||
|
||||
/// 알림을 눌렀을 때 — 탭으로 간 뒤 실제 해당 화면을 연다(v1.5 8장 Deep Link · 9장 Eclipse).
|
||||
void _openFromPush(PushNotice notice) {
|
||||
_router.go(notice.route);
|
||||
final route = _pushRoute(notice.target);
|
||||
if (route == null) return;
|
||||
// 탭 전환이 그려진 다음에 연다. 그 전에 열면 go 가 새로 짠 화면 스택이 덮는다.
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) => _router.routerDelegate.navigatorKey.currentState?.push(route),
|
||||
);
|
||||
}
|
||||
|
||||
Route<void>? _pushRoute(String? target) => switch (target?.split('/')) {
|
||||
['eclipse', final id] when id.isNotEmpty => eclipseDefendRoute(
|
||||
repository: _repos.eclipse,
|
||||
fandomId: id,
|
||||
),
|
||||
['planets', final id] when id.isNotEmpty => MaterialPageRoute(
|
||||
builder: (_) => PlanetDetailScreen(
|
||||
repository: _repos.planet(id),
|
||||
watchPlanet: _repos.watchPlanet,
|
||||
eclipse: _repos.eclipse,
|
||||
),
|
||||
),
|
||||
_ => switch (target == null ? null : _notificationScreen(target)) {
|
||||
final screen? => MaterialPageRoute(builder: (_) => screen),
|
||||
null => null,
|
||||
},
|
||||
};
|
||||
|
||||
/// 알림함 항목 → 화면(명세 `518:88353`). INSIDE · 라운지 게시물 이동은 그 알림을 만드는
|
||||
/// 3차 범위와 함께 붙는다 — 지금은 경로를 모르는 것으로 두어 이동하지 않는다.
|
||||
|
||||
Reference in New Issue
Block a user