💄 Optimized notification snack bar

This commit is contained in:
2025-06-26 02:12:38 +08:00
parent 2b237eaad9
commit 60c5e584be
6 changed files with 127 additions and 696 deletions

View File

@ -1,7 +1,10 @@
import 'dart:async';
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/services/notify.dart';
import 'package:island/services/sharing_intent.dart';
@RoutePage()
@ -11,10 +14,15 @@ class AppWrapper extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
useEffect(() {
StreamSubscription? ntySubs;
Future(() {
if (context.mounted) ntySubs = setupNotificationListener(context, ref);
});
final sharingService = SharingIntentService();
sharingService.initialize(context);
return () {
sharingService.dispose();
ntySubs?.cancel();
};
}, const []);