How do I create async function in Dart?

Here, the function variable type just needs to specify that it returns a Future: class Example { Future<void> Function() asyncFuncVar ; Future<void> asyncFunc() async => print(‘Do async stuff…’); Example() { asyncFuncVar = asyncFunc; asyncFuncVar(). then((_) => print(‘Hello’)); } } void main() => Example();

Sizin İçin Seçtik  WhiteCoin kaç TL?

Leave a Reply

Your email address will not be published. Required fields are marked *