I've created two functions. I want that when the first one is completed count() the text() function will be executed. But it's not working as expected. Where is the problem?
Future<void> count() async {
for (var i = 1; i <= 10; i++) {
Future.delayed(Duration(seconds: i), () => print(i));
}
}
Future<void> text() async{
print("Done");
}
void main() {
count().then((value) {
text();
});
}