Skip to content

Files

Latest commit

 

History

History
24 lines (17 loc) · 489 Bytes

avoid_void_async.md

File metadata and controls

24 lines (17 loc) · 489 Bytes

Pattern: Use of void async

Issue: -

Description

When declaring an async method or function which does not return a value, declare that it returns Future<void> and not just void.

Example of incorrect code:

void f() async {}
void f2() async => null;

Example of correct code:

Future<void> f() async {}
Future<void> f2() async => null;

Further Reading