Skip to content

Commit bf9e1f8

Browse files
committed
fix(android_alarm_manager_plus): EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK
1 parent b9bb8a0 commit bf9e1f8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • packages/android_alarm_manager_plus/example/lib

packages/android_alarm_manager_plus/example/lib/main.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class _AlarmHomePageState extends State<_AlarmHomePage> {
8282

8383
void _checkExactAlarmPermission() async {
8484
final currentStatus = await Permission.scheduleExactAlarm.status;
85+
if (!mounted) return;
8586
setState(() {
8687
_exactAlarmPermissionStatus = currentStatus;
8788
});
@@ -91,7 +92,7 @@ class _AlarmHomePageState extends State<_AlarmHomePage> {
9192
developer.log('Increment counter!');
9293
// Ensure we've loaded the updated count from the background isolate.
9394
await prefs?.reload();
94-
95+
if (!mounted) return;
9596
setState(() {
9697
_counter++;
9798
});

0 commit comments

Comments
 (0)