|
|
@ -44,7 +44,7 @@ abstract interface class AppsBlocStates { |
|
|
|
BehaviorSubject<void> get openNotifications; |
|
|
|
BehaviorSubject<void> get openNotifications; |
|
|
|
|
|
|
|
|
|
|
|
/// A collection of unsupported apps and their minimum required version. |
|
|
|
/// A collection of unsupported apps and their minimum required version. |
|
|
|
BehaviorSubject<Map<String, String?>> get appVersions; |
|
|
|
BehaviorSubject<Map<String, VersionCheck>> get appVersionChecks; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// The Bloc responsible for managing the [AppImplementation]s. |
|
|
|
/// The Bloc responsible for managing the [AppImplementation]s. |
|
|
@ -131,12 +131,12 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
final notSupported = <String, String?>{}; |
|
|
|
final notSupported = <String, VersionCheck>{}; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
final coreCheck = _account.client.core.isSupported(capabilities.requireData); |
|
|
|
final coreCheck = _account.client.core.getVersionCheck(capabilities.requireData); |
|
|
|
if (!coreCheck.isSupported) { |
|
|
|
if (!coreCheck.isSupported) { |
|
|
|
notSupported['core'] = coreCheck.minimumVersion.toString(); |
|
|
|
notSupported['core'] = coreCheck; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e, s) { |
|
|
|
} catch (e, s) { |
|
|
|
debugPrint(e.toString()); |
|
|
|
debugPrint(e.toString()); |
|
|
@ -145,14 +145,14 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
|
|
|
|
|
|
|
|
for (final app in apps.requireData) { |
|
|
|
for (final app in apps.requireData) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
final check = await app.isSupported(_account, capabilities.requireData); |
|
|
|
final check = await app.getVersionCheck(_account, capabilities.requireData); |
|
|
|
|
|
|
|
|
|
|
|
if (check == null) { |
|
|
|
if (check == null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!check.isSupported) { |
|
|
|
if (!check.isSupported) { |
|
|
|
notSupported[app.id] = check.minimumVersion; |
|
|
|
notSupported[app.id] = check; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e, s) { |
|
|
|
} catch (e, s) { |
|
|
|
debugPrint(e.toString()); |
|
|
|
debugPrint(e.toString()); |
|
|
@ -161,7 +161,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (notSupported.isNotEmpty) { |
|
|
|
if (notSupported.isNotEmpty) { |
|
|
|
appVersions.add(notSupported); |
|
|
|
appVersionChecks.add(notSupported); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -190,7 +190,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
unawaited(notificationsAppImplementation.close()); |
|
|
|
unawaited(notificationsAppImplementation.close()); |
|
|
|
unawaited(activeApp.close()); |
|
|
|
unawaited(activeApp.close()); |
|
|
|
unawaited(openNotifications.close()); |
|
|
|
unawaited(openNotifications.close()); |
|
|
|
unawaited(appVersions.close()); |
|
|
|
unawaited(appVersionChecks.close()); |
|
|
|
|
|
|
|
|
|
|
|
super.dispose(); |
|
|
|
super.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
@ -209,7 +209,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
BehaviorSubject<void> openNotifications = BehaviorSubject(); |
|
|
|
BehaviorSubject<void> openNotifications = BehaviorSubject(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
BehaviorSubject<Map<String, String?>> appVersions = BehaviorSubject(); |
|
|
|
BehaviorSubject<Map<String, VersionCheck>> appVersionChecks = BehaviorSubject(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Future<void> refresh() async { |
|
|
|
Future<void> refresh() async { |
|
|
|