srawlins / timezone

Time zone database and time zone aware DateTime object for Dart.
BSD 2-Clause "Simplified" License
102 stars 54 forks source link

Error in new flutter/dart version #14

Closed bigboateng closed 2 years ago

bigboateng commented 6 years ago

compiler message: Change to a supertype of dart.core::DateTime (or, for a covariant parameter, a subtype).
compiler message:   Duration difference(TZDateTime other) {
compiler message:                                  ^
compiler message: file:///b/build/slave/Linux_Engine/build/src/third_party/dart/runtime/lib/date_patch.dart: Context: This is the overriden method ('difference').
compiler message: file:///Users/boatengyeboah/.pub-cache/hosted/pub.dartlang.org/timezone-0.4.3/lib/src/date_time.dart:386:36: Error: The parameter 'other' of the method 'TZDateTime::isAtSameMomentAs' has type timezone.src.date_time::TZDateTime, which does not match the corresponding type in the overridden method (dart.core::DateTime).
compiler message: Change to a supertype of dart.core::DateTime (or, for a covariant parameter, a subtype).
compiler message:   bool isAtSameMomentAs(TZDateTime other) {
compiler message:                                    ^
compiler message: file:///b/build/slave/Linux_Engine/build/src/third_party/dart/sdk/lib/core/date_time.dart: Context: This is the overriden method ('isAtSameMomentAs').
compiler message: file:///Users/boatengyeboah/.pub-cache/hosted/pub.dartlang.org/timezone-0.4.3/lib/src/date_time.dart:396:28: Error: The parameter 'other' of the method 'TZDateTime::compareTo' has type timezone.src.date_time::TZDateTime, which does not match the corresponding type in the overridden method (dart.core::DateTime).
compiler message: Change to a supertype of dart.core::DateTime (or, for a covariant parameter, a subtype).
compiler message:   int compareTo(TZDateTime other) => millisecondsSinceEpoch.compareTo(other.millisecondsSinceEpoch);
compiler message:                            ^
compiler message: file:///b/build/slave/Linux_Engine/build/src/third_party/dart/sdk/lib/core/date_time.dart: Context: This is the overriden method ('compareTo').
compiler message: file:///Users/boatengyeboah/.pub-cache/hosted/pub.dartlang.org/timezone-0.4.3/lib/src/date_time.dart:11:7: Error: The non-abstract class 'TZDateTime' is missing implementations for these members:
compiler message:   'microsecondsSinceEpoch', 'microsecond'.
compiler message: Try to either
compiler message:  - provide an implementation,
compiler message:  - inherit an implementation from a superclass or mixin,
compiler message:  - mark the class as abstract, or
compiler message:  - provide a 'noSuchMethod' implementation.
compiler message: 
compiler message: class TZDateTime implements DateTime {
compiler message:       ^^^^^^^^^^
compiler message: file:///b/build/slave/Linux_Engine/build/src/third_party/dart/runtime/lib/date_patch.dart: Context: 'microsecondsSinceEpoch' is defined here.
compiler message: file:///b/build/slave/Linux_Engine/build/src/third_party/dart/runtime/lib/date_patch.dart: Context: 'microsecond' is defined here.```
srawlins commented 6 years ago

Do you have any steps to reproduce?

bigboateng commented 6 years ago

Just using the library in this dart version Tools • Dart 2.0.0-dev.60.0.flutter-a5e41681e5 causes that problem. Was using the example code specified on pub

srawlins commented 4 years ago

I suspect 2.0.0 is too old for this package now; I am bumping the minimum supported version to 2.1.0. Can you reproduce with Dart 2.1.0 or newer?