Skip to content

Commit

Permalink
Fix few thing about of PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
leynier committed Mar 6, 2021
1 parent 5e59b11 commit 9eb10a8
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions lib/src/plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ class DeviceApps {
throw Exception('The package name can not be empty');
}
return await (_methodChannel.invokeMethod(
'openApp',
<String, String>{
'package_name': packageName,
},
) as FutureOr<bool>);
'openApp', <String, String>{'package_name': packageName}));
}

/// Launch the Settings screen of the app based on its [packageName]
Expand All @@ -131,11 +127,7 @@ class DeviceApps {
}

return await (_methodChannel.invokeMethod(
'openAppSettings',
<String, String>{
'package_name': packageName,
},
) as FutureOr<bool>);
'openAppSettings', <String, String>{'package_name': packageName}));
}

/// Listen to app changes: installations, uninstallations, updates, enabled or
Expand All @@ -144,9 +136,10 @@ class DeviceApps {
static Stream<ApplicationEvent> listenToAppsChanges() {
return _eventChannel
.receiveBroadcastStream()
.map(((dynamic event) =>
ApplicationEvent._(event as Map<Object, Object>)))
.handleError((Object err) => null);
.map(((Object event) =>
ApplicationEvent._(event as Map<Object, Object>))
as Function(dynamic))
.handleError((Object err) => null) as Stream<ApplicationEvent>;
}
}

Expand Down Expand Up @@ -195,7 +188,7 @@ class Application extends _BaseApplication {

/// Whether the app is enabled (installed and visible)
/// or disabled (installed, but not visible)
final bool? enabled;
final bool enabled;

factory Application._(Map<Object, Object> map) {
if (map.length == 0) {
Expand All @@ -217,7 +210,7 @@ class Application extends _BaseApplication {
systemApp = map['system_app'] as bool,
installTimeMillis = map['install_time'] as int,
updateTimeMillis = map['update_time'] as int,
enabled = map['is_enabled'] as bool?,
enabled = map['is_enabled'] as bool,
category = _parseCategory(map['category']),
super._fromMap(map);

Expand Down

0 comments on commit 9eb10a8

Please sign in to comment.