fix(flutter): request notification permission proactively (TODO-041)

When user enables poke notifications, call requestPermission()
immediately so OS prompt appears on first enable, not lazily.
This commit is contained in:
Edison Jwa
2026-06-11 20:44:17 +09:00
parent ef19f4e7ce
commit 00e3fa7ad5
2 changed files with 23 additions and 3 deletions
@@ -3,6 +3,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:chanora_flutter/l10n/generated/app_localizations.dart';
import 'package:chanora_flutter/services/poke_notification_service.dart';
import 'package:chanora_flutter/services/poke_preferences_service.dart';
import 'package:chanora_flutter/widgets/poke_notification_settings.dart';
@@ -14,11 +15,16 @@ void main() {
await preferences.muteSender(BigInt.from(42));
addTearDown(preferences.dispose);
final notificationService = PokeNotificationService();
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: AppL10n.localizationsDelegates,
supportedLocales: AppL10n.supportedLocales,
home: PokeNotificationSettingsDialog(preferences: preferences),
home: PokeNotificationSettingsDialog(
preferences: preferences,
notificationService: notificationService,
),
),
);