Skip to content

Instantly share code, notes, and snippets.

@Keksinautin
Last active January 9, 2019 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keksinautin/5366adf409b6762440cdf3c60ab5404b to your computer and use it in GitHub Desktop.
Save Keksinautin/5366adf409b6762440cdf3c60ab5404b to your computer and use it in GitHub Desktop.
Error: A value of type 'int' can't be assigned to a parameter of type 'FutureOr<int>'.
import 'dart:async';
class A {
final FutureOr<int> a;
const A({this.a: 2});
}
void main() async {
final b = const A(); // Here we have an error;
///But in this case it works well
//final b = new A();
print(b.a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment