How can I wait for data before it is available - flutter
问题 @override void didChangeDependencies() async { if (_isInit) { print('First stat'); final restaurant = await Provider.of<Restaurants>(context, listen: false) .fetchAndSetRestaurants(); print('test'); } _isInit = false; super.didChangeDependencies(); } bool showFavourites = false; @override Widget build(BuildContext context) { return Scaffold( //bottomNavigationBar: BottomNavBar(), appBar: homeAppBar(context), body: SingleChildScrollView( child: showFavourites ? Padding( padding: const