Open busslina opened 8 months ago
I think because of the parallel web-support which enforces usage as Future<>.
You can use this design:
abstract interface class Interface {
FutureOr<SecretKey> newSecretKeyFromBytes(List<int> bytes);
}
class ImplementationWeb extends Interface {
@override
Future<SecretKey> newSecretKeyFromBytes(List<int> bytes) =>
throw ('Not implemented');
}
class ImplementationNative extends Interface {
@override
SecretKey newSecretKeyFromBytes(List<int> bytes) => throw ('Not implemented');
}
This async
is make me changing too much method signatures
I would have to agree with this. I want to use cryptography
in the uuid
library, but it being async, would require me to change my entire library to async functions, which would not only break everyone using the library, but is unnecessary.
The above design would go a long way to solving that for those that don't need it.