Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to include the package in a Flutter app #7

Open
cjarman opened this issue Jun 10, 2018 · 1 comment
Open

Unable to include the package in a Flutter app #7

cjarman opened this issue Jun 10, 2018 · 1 comment

Comments

@cjarman
Copy link

cjarman commented Jun 10, 2018

import 'package:timezone/standalone.dart';
import 'package:timezone/timezone.dart';

class MyHomePageState extends State {
@OverRide
void initState() {
initializeTimeZone().then((
) {
final detroit = getLocation('America/Detroit');
final now = new TZDateTime.now(detroit);
});
}
}

Compile time warning is as follows:

compiler message: file:///Users/craigjarman/.pub-cache/hosted/pub.dartlang.org/timezone-0.4.3/lib/src/date_time.dart:321:34: Error: The parameter 'other' of the method 'TZDateTime::difference' 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: 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/craigjarman/.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/craigjarman/.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/craigjarman/.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.
Compiler failed on lib/main.dart

@localvoid
Copy link
Owner

Hi, I've stopped maintaining this library long time ago, maintained repo is here: https://github.com/srawlins/timezone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants