skip to Main Content

Flutter – Why does not "await" work in async method?

Why does not "await" work? Future<void> f1() async{ Future.delayed(Duration(seconds:2), (){ print('f1'); }); } void main() async{ print('start'); await f1(); print('end'); } output start end f1 but await working in next code. Future<void> f1() async{ return Future.delayed(Duration(seconds:2), (){ print('f1'); }); }…

VIEW QUESTION

"is" operator expected behavior in dart flutter

I have slightly strange issue (I am probably missing something) I decided to iterate over element tree in Flutter and had the following question: if (element.widget.runtimeType == GestureDetector) { print('return true1'); } if (element.widget.runtimeType is GestureDetector) { print('return true2'); }…

VIEW QUESTION
Back To Top
Search