Skip to content

Commit

Permalink
refactor: Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
witwash committed Aug 14, 2024
1 parent e0e6865 commit 3ee836e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 9 additions & 5 deletions kiosk_mode/lib/kiosk_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ enum KioskMode {
///
/// [1]: https://developer.android.com/reference/android/app/Activity#startLockTask()
/// [2]: https://developer.apple.com/documentation/uikit/uiaccessibility/1615186-requestguidedaccesssession/
// ignore: prefer-boolean-prefixes, a valid name with bool result
Future<bool> startKioskMode() => _channel
.invokeMethod<bool>('startKioskMode')
.then((value) => value ?? false);
.then((didStartKioskMode) => didStartKioskMode ?? false);

/// On Android, stops the current task from being locked. On iOS, exits the Single App mode.
///
Expand All @@ -42,16 +43,19 @@ Future<bool> startKioskMode() => _channel
/// On iOS, the result will be `true` if the request was fulfilled, `false` - otherwise.
///
/// [1]: https://developer.android.com/reference/android/app/Activity#stopLockTask()
// ignore: prefer-boolean-prefixes, a valid name with a bool result
Future<bool?> stopKioskMode() => _channel.invokeMethod<bool>('stopKioskMode');

/// Returns the current [KioskMode].
///
/// On Android, it calls `isInLockTaskMode`.
///
/// On iOS, it returns result of `UIAccessibility.isGuidedAccessEnabled`.
Future<KioskMode> getKioskMode() => _channel
.invokeMethod<bool>('isInKioskMode')
.then((value) => value == true ? KioskMode.enabled : KioskMode.disabled);
Future<KioskMode> getKioskMode() =>
_channel.invokeMethod<bool>('isInKioskMode').then(
(isInKioskMode) =>
isInKioskMode == true ? KioskMode.enabled : KioskMode.disabled,
);

/// Returns `true`, if app is in a proper managed kiosk mode.
///
Expand All @@ -64,7 +68,7 @@ Future<KioskMode> getKioskMode() => _channel
/// detection of Apple Business Manager yet.
Future<bool> isManagedKiosk() => _channel
.invokeMethod<bool>('isManagedKiosk')
.then((value) => value == true);
.then((isManagedKiosk) => isManagedKiosk == true);

/// Returns the stream with [KioskMode].
///
Expand Down
2 changes: 2 additions & 0 deletions remote_logger/lib/src/remote_logger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class RemoteLogger {
final GetHeaders _getHeaders;
Duration _currentTimeout = _initialTimeout;

// ignore: dispose-class-fields, we don't want to dispose a user-provided client.
final Client? _client;
Client? _internalClient;

Expand All @@ -84,6 +85,7 @@ class RemoteLogger {
///
/// `true` means either the record was posted or the error was not retriable,
/// in any case we can move to the next record.
// ignore: prefer-boolean-prefixes, a valid name with a bool result
Future<bool> _processRecord(String record) async {
try {
final headers = await _getHeaders(_defaultHeaders);
Expand Down

0 comments on commit 3ee836e

Please sign in to comment.