From ffb67a58048e3eadcd7ac397d0b8b47eb3dc5bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wr=C3=B3blewski?= Date: Fri, 8 Nov 2024 20:08:26 +0100 Subject: [PATCH] chore: prepare 5.0.1 --- CHANGELOG.md | 8 +++++++- example/pubspec.lock | 2 +- lib/src/floating.dart | 10 +++++++++- pubspec.yaml | 2 +- test/src/floating_test.dart | 1 + 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 572b0a3..6f1e6fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# 5.0.0 +## 5.0.1 + +* Avoid excessive `hasSystemFeature` calls + +Thanks [@yoer](https://github.com/yoer)! + +## 5.0.0 * *BREAKING* Switch to declarative Gradle plugin setup * Add switching animation to `PiPSwitcher` diff --git a/example/pubspec.lock b/example/pubspec.lock index e41ce59..303068b 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -63,7 +63,7 @@ packages: path: ".." relative: true source: path - version: "5.0.0" + version: "5.0.1" flutter: dependency: "direct main" description: flutter diff --git a/lib/src/floating.dart b/lib/src/floating.dart index 6369e24..736c516 100644 --- a/lib/src/floating.dart +++ b/lib/src/floating.dart @@ -30,11 +30,19 @@ class Floating { Timer? _timer; Stream? _stream; - bool? _isPipAvailable; static final _singleton = Floating._internal(); + @visibleForTesting + void reset() { + lastEnableArguments = null; + _timer?.cancel(); + _timer = null; + _stream = null; + _isPipAvailable = null; + } + /// Facilities Floating singleton access. /// /// PiP settings are global anyway, no point of making this instanceable. diff --git a/pubspec.yaml b/pubspec.yaml index 50b2324..49e3560 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: floating description: Picture in Picture mode management for Flutter. Available only for Android. -version: 5.0.0 +version: 5.0.1 homepage: https://github.com/wrbl606/floating screenshots: - description: 'This screenshot shows the transformation from a full-screen application to a movable picture-in-picture form.' diff --git a/test/src/floating_test.dart b/test/src/floating_test.dart index fab7b37..5612076 100644 --- a/test/src/floating_test.dart +++ b/test/src/floating_test.dart @@ -24,6 +24,7 @@ void main() { }); tearDown(() { + Floating().reset(); tester.setMockMethodCallHandler(channel, null); });