From 7c605c5c1c244f7f121bad2d526e4ab3530c2638 Mon Sep 17 00:00:00 2001 From: Gautier de Lataillade Date: Wed, 28 Aug 2024 11:04:48 +0200 Subject: [PATCH] Update flutter_fgbg dependency --- example/pubspec.lock | 6 +++--- lib/service/alarm_storage.dart | 3 ++- lib/src/ios_alarm.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 05267df7..aad6ab73 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "3.1.5" + version: "4.0.0-dev.1" async: dependency: transitive description: @@ -89,10 +89,10 @@ packages: dependency: transitive description: name: flutter_fgbg - sha256: "08c4d2fd229e3df26083d5aecc3dea9ff4f2d188f8cd57aaf2b3f047bd08a047" + sha256: e02ad0738ba5fc7f331b62acb0d74aa540626a6441ae18fad685faa5ac4ad7a5 url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.6.0" flutter_test: dependency: "direct dev" description: flutter diff --git a/lib/service/alarm_storage.dart b/lib/service/alarm_storage.dart index d34de4ee..2d9a6e0a 100644 --- a/lib/service/alarm_storage.dart +++ b/lib/service/alarm_storage.dart @@ -34,7 +34,8 @@ class AlarmStorage { /// Reloads the shared preferences instance in the case modifications /// were made in the native code, after a notification action. - fgbgSubscription = FGBGEvents.stream.listen((event) => prefs.reload()); + fgbgSubscription = + FGBGEvents.instance.stream.listen((event) => prefs.reload()); } /// Saves alarm info in local storage so we can restore it later diff --git a/lib/src/ios_alarm.dart b/lib/src/ios_alarm.dart index 2d75a477..b80c0e62 100644 --- a/lib/src/ios_alarm.dart +++ b/lib/src/ios_alarm.dart @@ -130,7 +130,7 @@ class IOSAlarm { required void Function() onForeground, required void Function() onBackground, }) { - fgbgSubscriptions[id] = FGBGEvents.stream.listen((event) { + fgbgSubscriptions[id] = FGBGEvents.instance.stream.listen((event) { if (event == FGBGType.foreground) onForeground(); if (event == FGBGType.background) onBackground(); }); diff --git a/pubspec.yaml b/pubspec.yaml index bdb9bf6f..15d2959d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - flutter_fgbg: ^0.3.0 + flutter_fgbg: ^0.6.0 shared_preferences: ^2.2.3 dev_dependencies: