However, this is however a behavioral change for people extending BuiltList themselves, since the hashCode operation is now slower, which means they will have to add back this piece of code themselves.
int? _hashCode;
@override
int get hashCode {
_hashCode ??= hashObjects(_list);
return _hashCode!;
}
P.S.: I have found 0 instances of people extending BuiltList on github.
fixes https://github.com/google/built_collection.dart/issues/164
This PR adds a
const factory BuiltList.fromList([List<E> list])
which creates a new subclass_ConstBuiltList
that only has a const constructor.a similar approach is also used to add support for const BuiltSet and other built collections.
this is a non-breaking change, since classes most likely extend BuiltList, and even if they implement it, they will just get a warning
override_on_non_overriding_member
lint.However, this is however a behavioral change for people extending BuiltList themselves, since the
hashCode
operation is now slower, which means they will have to add back this piece of code themselves.P.S.: I have found 0 instances of people extending BuiltList on github.
cc @davidmorgan