Flutter Await not waiting
问题 Why won't the program wait for the function to return the list before going to the print statement? I think it's because I made the forEach loop async but I need it to be async to get the newSummary which is a Future. Future syncToCloud() async{ final List<Map<String,dynamic>> _events = await events(); print(_events.length); } Future<List<Map<String, dynamic>>> events() async { List<Map<String, dynamic>> maps = await db.query('data'); List<Map<String, dynamic>> newMaps=[]; maps.forEach(