-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-corestatus-blockedBlocked from making progress by another (referenced) issueBlocked from making progress by another (referenced) issuetype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
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?
Metadata
Metadata
Assignees
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-corestatus-blockedBlocked from making progress by another (referenced) issueBlocked from making progress by another (referenced) issuetype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug