You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did find I can return a mutable map to avoid the lint message, but is more like a workaround
import'dart:developer';
import'package:fast_immutable_collections/fast_immutable_collections.dart';
voidmain() {
/// Map<String, String> mapfinal map = {'key':'value'};
/// IMap<String, String> immutableMapfinal immutableMap = map.lock;
/// IMap<String, String> otherImmutableMapfinal otherImmutableMap =IMap(const {"key":'value'});
// Works fine, doesn't show any lint message:log(map['key']!);
// Shows: avoid using the bang operator. It may result in runtime exceptions.log(immutableMap['key']!);
log(otherImmutableMap['key']!);
// Workaround to avoid the lint message:log(immutableMap.unlock['key']!);
log(otherImmutableMap.unlock['key']!);
}
Hi, currently using https://pub.dev/packages/fast_immutable_collections and with these lint give a warning for every IMap call.
Is feasible to add the exception? or maybe add the possibility to add valid types in the yaml file or disable the warning at all.
The warning is "Avoid using the bang operator. It may result in runtime exceptions."
The text was updated successfully, but these errors were encountered: