I am reading over the documentation for Flutter.
On this page, I have observed the following curious method. In the method, the declared return type is Future. The method though, does not have the return keyword present anywhere. Why is this?
Future<void> _incrementCounter() async {
setState(() {
_counter++;
});
Directory directory = await getApplicationDocumentsDirectory();
final String dirName = directory.path;
await File('$dir/counter.txt').writeAsString('$_counter');
}
I have been able to ascertain that all flutter functions return a value, and the default return value is null. But if this method always returns null, then why declare a return type of Future<void>?