From 809270e9b1c138298519bfa9da1e037b7d4045e6 Mon Sep 17 00:00:00 2001 From: Gautier de Lataillade Date: Wed, 28 Aug 2024 11:28:06 +0200 Subject: [PATCH] Update dependencies & increment version to 3.1.6 --- CHANGELOG.md | 4 ++ example/lib/screens/edit_alarm.dart | 4 +- example/lib/screens/home.dart | 2 +- example/lib/screens/ring.dart | 9 +++-- example/pubspec.lock | 58 ++++++++++++++--------------- lib/src/ios_alarm.dart | 2 +- pubspec.yaml | 6 +-- 7 files changed, 46 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8928acb0..904fe5f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.1.6 +* Update `flutter_fgbg` dependency to `0.6.0`. +* Update `shared_preferences` dependency to `2.3.2`. + ## 3.1.5 * [Android] Fix volume/focus post-alarm. * Export `AlarmSettings` class in `Alarm` class. diff --git a/example/lib/screens/edit_alarm.dart b/example/lib/screens/edit_alarm.dart index 7950d802..85154710 100644 --- a/example/lib/screens/edit_alarm.dart +++ b/example/lib/screens/edit_alarm.dart @@ -106,14 +106,14 @@ class _ExampleAlarmEditScreenState extends State { if (loading) return; setState(() => loading = true); Alarm.set(alarmSettings: buildAlarmSettings()).then((res) { - if (res) Navigator.pop(context, true); + if (res && mounted) Navigator.pop(context, true); setState(() => loading = false); }); } void deleteAlarm() { Alarm.stop(widget.alarmSettings!.id).then((res) { - if (res) Navigator.pop(context, true); + if (res && mounted) Navigator.pop(context, true); }); } diff --git a/example/lib/screens/home.dart b/example/lib/screens/home.dart index 9bfb4992..da476d88 100644 --- a/example/lib/screens/home.dart +++ b/example/lib/screens/home.dart @@ -110,7 +110,7 @@ class _ExampleAlarmHomeScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: const Text('alarm 3.1.5')), + appBar: AppBar(title: const Text('alarm 3.1.6')), body: SafeArea( child: alarms.isNotEmpty ? ListView.separated( diff --git a/example/lib/screens/ring.dart b/example/lib/screens/ring.dart index d04937a0..cde6849e 100644 --- a/example/lib/screens/ring.dart +++ b/example/lib/screens/ring.dart @@ -34,7 +34,9 @@ class ExampleAlarmRingScreen extends StatelessWidget { now.minute, ).add(const Duration(minutes: 1)), ), - ).then((_) => Navigator.pop(context)); + ).then((_) { + if (context.mounted) Navigator.pop(context); + }); }, child: Text( 'Snooze', @@ -43,8 +45,9 @@ class ExampleAlarmRingScreen extends StatelessWidget { ), RawMaterialButton( onPressed: () { - Alarm.stop(alarmSettings.id) - .then((_) => Navigator.pop(context)); + Alarm.stop(alarmSettings.id).then((_) { + if (context.mounted) Navigator.pop(context); + }); }, child: Text( 'Stop', diff --git a/example/pubspec.lock b/example/pubspec.lock index 589e3178..bc0aeccd 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "3.1.4" + version: "3.1.5" 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 @@ -107,18 +107,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -139,18 +139,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" path: dependency: transitive description: @@ -251,58 +251,58 @@ packages: dependency: transitive description: name: shared_preferences - sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180 + sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "93d0ec9dd902d85f326068e6a899487d1f65ffcd5798721a95330b26c8131577" + sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7" + sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.5.2" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a" + sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.1" sky_engine: dependency: transitive description: flutter @@ -352,10 +352,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" vector_math: dependency: transitive description: @@ -376,10 +376,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" web: dependency: transitive description: diff --git a/lib/src/ios_alarm.dart b/lib/src/ios_alarm.dart index 0384504c..f178c9b2 100644 --- a/lib/src/ios_alarm.dart +++ b/lib/src/ios_alarm.dart @@ -126,7 +126,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 5bce0159..46459d0c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: alarm description: A simple Flutter alarm manager plugin for both iOS and Android. -version: 3.1.5 +version: 3.1.6 homepage: https://github.com/gdelataillade/alarm environment: @@ -10,8 +10,8 @@ environment: dependencies: flutter: sdk: flutter - flutter_fgbg: ^0.3.0 - shared_preferences: ^2.2.2 + flutter_fgbg: ^0.6.0 + shared_preferences: ^2.3.2 dev_dependencies: flutter_test: