UX·FX v1.5 — 햅틱 단계 · 라이브 띠 · HERO 전광판 · Push 우선순위 · Shield · 이클립스 성공·실패 연출
This commit is contained in:
+29
-19
@@ -228,28 +228,38 @@ class _FancakeAppState extends State<FancakeApp> with WidgetsBindingObserver {
|
||||
void _showInApp(PushNotice notice) {
|
||||
// 타임어택 발동 · 퀘스트 완료 등 — HOME 카드가 바로 따라오게 다시 읽힌다.
|
||||
homeRefreshSignal.value++;
|
||||
if (!notice.hasText) return;
|
||||
_messengerKey.currentState
|
||||
?..hideCurrentSnackBar()
|
||||
..showSnackBar(
|
||||
SnackBar(
|
||||
behavior: SnackBarBehavior.floating,
|
||||
// action 이 있으면 기본으로 남아 있으므로(Flutter 3.29+) 시간이 지나면 닫히게 한다.
|
||||
persist: false,
|
||||
duration: const Duration(seconds: 4),
|
||||
content: Text(
|
||||
[notice.title, notice.body].where((s) => s.isNotEmpty).join('\n'),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
if (!notice.hasText || !shouldShowInApp(notice, _inAppShowing)) return;
|
||||
final messenger = _messengerKey.currentState;
|
||||
if (messenger == null) return;
|
||||
messenger.hideCurrentSnackBar();
|
||||
_inAppShowing = notice;
|
||||
messenger
|
||||
.showSnackBar(
|
||||
SnackBar(
|
||||
behavior: SnackBarBehavior.floating,
|
||||
// action 이 있으면 기본으로 남아 있으므로(Flutter 3.29+) 시간이 지나면 닫히게 한다.
|
||||
persist: false,
|
||||
duration: const Duration(seconds: 4),
|
||||
content: Text(
|
||||
[notice.title, notice.body].where((s) => s.isNotEmpty).join('\n'),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
action: SnackBarAction(
|
||||
label: (_messengerKey.currentContext ?? context).l10n.commonView,
|
||||
onPressed: () => _openFromPush(notice),
|
||||
),
|
||||
),
|
||||
action: SnackBarAction(
|
||||
label: (_messengerKey.currentContext ?? context).l10n.commonView,
|
||||
onPressed: () => _openFromPush(notice),
|
||||
),
|
||||
),
|
||||
);
|
||||
)
|
||||
.closed
|
||||
.then((_) {
|
||||
if (identical(_inAppShowing, notice)) _inAppShowing = null;
|
||||
});
|
||||
}
|
||||
|
||||
/// 지금 떠 있는 앱 안 알림. 닫히면 비운다.
|
||||
PushNotice? _inAppShowing;
|
||||
|
||||
void _openFromPush(PushNotice notice) => _router.go(notice.route);
|
||||
|
||||
/// 알림함 항목 → 화면(명세 `518:88353`). INSIDE · 라운지 게시물 이동은 그 알림을 만드는
|
||||
|
||||
Reference in New Issue
Block a user