Browse Source

Merge pull request #410 from Leptopoda/cleanup/iterable

neon: relax some iterable types
pull/412/head
Nikolas Rimikis 2 years ago committed by GitHub
parent
commit
35988bee91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      packages/neon/neon/lib/src/app.dart
  2. 2
      packages/neon/neon/lib/src/utils/settings_export_helper.dart
  3. 4
      packages/settings/lib/src/options/select_option.dart

9
packages/neon/neon/lib/src/app.dart

@ -196,13 +196,10 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
exit(0);
}
final matches = _appRegex.allMatches(shortcutType).toList();
if (matches.isNotEmpty) {
final matches = _appRegex.allMatches(shortcutType);
final activeAccount = _accountsBloc.activeAccount.valueOrNull;
if (activeAccount == null) {
return;
}
await _openAppFromExternal(activeAccount, matches[0].group(1)!);
if (matches.isNotEmpty && activeAccount != null) {
await _openAppFromExternal(activeAccount, matches.first.group(1)!);
}
}

2
packages/neon/neon/lib/src/utils/settings_export_helper.dart

@ -33,7 +33,7 @@ class SettingsExportHelper {
final accountsData = data['accounts'] as Map<String, dynamic>;
for (final accountId in accountsData.keys) {
final account = accountSpecificOptions.keys.toList().find(accountId);
final account = accountSpecificOptions.keys.find(accountId);
if (account == null) {
return;
}

4
packages/settings/lib/src/options/select_option.dart

@ -25,9 +25,9 @@ class SelectOption<T> extends Option<T> {
}
T? _fromString(final Map<T, LabelBuilder> vs, final String? valueStr) {
final v = vs.keys.where((final e) => e.toString() == valueStr).toList();
final v = vs.keys.where((final e) => e.toString() == valueStr);
if (v.length == 1) {
return v[0];
return v.first;
}
return null;
}

Loading…
Cancel
Save