-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P4area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-quick-fixIssues with analysis server (quick) fixesIssues with analysis server (quick) fixestype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Input code:
class _A extends AsyncNotifier<img.Image?> {
@override
FutureOr<img.Image?> build() {
var a = await ref.watch(refImageCompatiblePathProvider.future);
// TODO: implement build
throw UnimplementedError();
}
}The await expression can only be used in an async function. Try marking the function body with either 'async' or 'async*'.
Apply quick fix:
class _A extends AsyncNotifier<img.Image?> {
@override
Future<img.Image?> build() async {
var a = await ref.watch(refImageCompatiblePathProvider.future);
// TODO: implement build
throw UnimplementedError();
}
}Expected code:
class _A extends AsyncNotifier<img.Image?> {
@override
FutureOr<img.Image?> build() async {
var a = await ref.watch(refImageCompatiblePathProvider.future);
// TODO: implement build
throw UnimplementedError();
}
}stephane-archerstephane-archer
Metadata
Metadata
Assignees
Labels
P4area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-quick-fixIssues with analysis server (quick) fixesIssues with analysis server (quick) fixestype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)