Open
Description
Hello everyone,
Currently DateTime.copyWith
is implemented via extension method:
https://api.flutter.dev/flutter/dart-core/DateTimeCopyWith/copyWith.html
Unfortunately this approach may lead to subtle bugs, because any other implementation of the DateTime class can call copyWith and be copied as the core lib implementation.
In our case, we are using timezone package, which provides an implementation of DateTime (TZDateTime). By using copyWith, we lose implicit information about the timezone.
Instead of having an extension method, is it viable to add copyWith as virtual method which can be overridden by subclasses?