Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue of too many Console logs caused by frequent access to h… #29

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/src/floating.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Floating {
Timer? _timer;
Stream<PiPStatus>? _stream;

bool? _isPipAvailable;

static final _singleton = Floating._internal();

/// Facilities Floating singleton access.
Expand All @@ -46,8 +48,8 @@ class Floating {
/// by admin or device manufacturer. Also, the device may
/// have Android version that was released without this feature.
Future<bool> get isPipAvailable async {
final bool? supportsPip = await _channel.invokeMethod('pipAvailable');
return supportsPip ?? false;
_isPipAvailable ??= await _channel.invokeMethod('pipAvailable');
return _isPipAvailable ?? false;
}

/// Checks current app PiP status.
Expand Down
Loading