Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Library doesn't work with dart 2 and Flutter #1

Closed
badboy-tian opened this issue May 11, 2018 · 6 comments
Closed

Library doesn't work with dart 2 and Flutter #1

badboy-tian opened this issue May 11, 2018 · 6 comments

Comments

@badboy-tian
Copy link

compiler message: file:///Users/tian/.pub-cache/hosted/pub.dartlang.org/web3dart-0.2.1/lib/src/web3client.dart:145:32: Error: A value of type '(dart.core::String) ??? dart.core::List<dart.core::int>' can't be assigned to a variable of type '(dynamic) ??? dart.async::FutureOr<dart.core::List<dart.core::int>>'.
compiler message: Try changing the type of the left hand side, or casting the right hand side to '(dynamic) ??? dart.async::FutureOr<dart.core::List<dart.core::int>>'.
compiler message: 					blockParam]).then(numbers.hexToBytes);
@badboy-tian
Copy link
Author

compiler message: file:///Users/tian/.pub-cache/hosted/pub.dartlang.org/pointycastle-0.11.1/lib/macs/hmac.dart:82:28: Error: The parameter 'params' of the method 'HMac::init' has type pointycastle.api::KeyParameter, which does not match the corresponding type in the overridden method (pointycastle.api::CipherParameters).
compiler message: Change to a supertype of pointycastle.api::CipherParameters (or, for a covariant parameter, a subtype).
compiler message:     void init(KeyParameter params) {
compiler message:                            ^
compiler message: file:///Users/tian/.pub-cache/hosted/pub.dartlang.org/pointycastle-0.11.1/lib/src/api/mac.dart:26:8: Context: This is the overriden method ('init').
compiler message:   void init(CipherParameters params);
compiler message:        ^
compiler message: file:///Users/tian/.pub-cache/hosted/pub.dartlang.org/pointycastle-0.11.1/lib/signers/ecdsa_signer.dart:129:55: Error: The parameter 'signature' of the method 'ECDSASigner::verifySignature' has type pointycastle.api.ecc::ECSignature, which does not match the corresponding type in the overridden method (pointycastle.api::Signature).
compiler message: Change to a supertype of pointycastle.api::Signature (or, for a covariant parameter, a subtype).
compiler message:   bool verifySignature(Uint8List message, ECSignature signature) {
compiler message:                                                       ^

@simolus3
Copy link
Owner

The crypto library used by this project isn't ready for dart 2 (which Flutter uses by default) yet. When PointyCastle/pointycastle#122 lands, I will upgrade this library so that it will work with Flutter.

If you urgently need to use this library, consider disabling dart 2 for Flutter with this guide. I will close this issue when this library and all its dependencies support dart 2, although that might break backwards-compatibility for some APIs.

@simolus3 simolus3 changed the title error flutter beta3 Library doesn't work with dart 2 and Flutter May 11, 2018
@badboy-tian
Copy link
Author

Thank you

@badboy-tian
Copy link
Author

@simolus3 Hi, the PointyCastle has a RC version solved the dart 2 problem. PointyCastle/pointycastle#125

@badboy-tian
Copy link
Author

@simolus3 can you please fix this issue ? thank you very much

@simolus3
Copy link
Owner

It should be fixed in version 0.3.0 of this library which is now out on pub. Let me know if you run into any further issues.

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

No branches or pull requests

2 participants