diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..7e7e7f6 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1 @@ +extensions: diff --git a/lib/widgets/entry_integration_settings.dart b/lib/widgets/entry_integration_settings.dart index cd47e45..ed07206 100644 --- a/lib/widgets/entry_integration_settings.dart +++ b/lib/widgets/entry_integration_settings.dart @@ -61,13 +61,13 @@ class _IntegrationSettingsWidgetState extends State { onChanged: (bool? show) { if (show != null) { final cubit = BlocProvider.of(context); - final newSettings = entry.browserSettings.copyWith(); - newSettings.matcherConfigs - .removeWhere((element) => element.matcherType == EntryMatcherType.Hide); + final newList = entry.browserSettings.matcherConfigs + .where((mc) => mc.matcherType != EntryMatcherType.Hide) + .toList(); if (!show) { - newSettings.matcherConfigs - .add(EntryMatcherConfig(matcherType: EntryMatcherType.Hide)); + newList.add(EntryMatcherConfig(matcherType: EntryMatcherType.Hide)); } + final newSettings = entry.browserSettings.copyWith(matcherConfigs: newList); cubit.update(browserSettings: newSettings); } }, @@ -173,9 +173,11 @@ class _MatchAccuracyRadioWidgetState extends State wit void onChanged(MatchAccuracy? value) { if (value != null) { final cubit = BlocProvider.of(context); - final newSettings = (cubit.state as EntryLoaded).entry.browserSettings.copyWith(); - newSettings.matcherConfigs.removeWhere((element) => element.matcherType == EntryMatcherType.Url); - newSettings.matcherConfigs.add(EntryMatcherConfig.forDefaultUrlMatchBehaviour(value)); + final entry = (cubit.state as EntryLoaded).entry; + final newList = + entry.browserSettings.matcherConfigs.where((mc) => mc.matcherType != EntryMatcherType.Url).toList(); + newList.add(EntryMatcherConfig.forDefaultUrlMatchBehaviour(value)); + final newSettings = entry.browserSettings.copyWith(matcherConfigs: newList); cubit.update(browserSettings: newSettings); } } diff --git a/pubspec.lock b/pubspec.lock index 1bc22ef..aa0d2ea 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -530,10 +530,10 @@ packages: description: path: "." ref: configv2 - resolved-ref: b24b601a9a47005690c145511acde1e771fef7b9 + resolved-ref: a28d62a423cc70a05f8325147b2ea102ffad29a4 url: "https://github.com/kee-org/kdbx.dart.git" source: git - version: "0.6.0+2" + version: "0.6.0+3" lints: dependency: transitive description: