Initializing state of late variables in flutter
class _HomeViewState extends State<HomeView> { late UserInfo currentUser; @override void didChangeDependencies() async { super.didChangeDependencies(); await dbService.getUserInfo(uid).then((value) { setState(() { currentUser = value!; }); }); } @override Widget build(BuildContext context) { return Scaffold( body: ListView( children: [ Container( child: currentUser != null ? welcomeText(currentUser) : const Center( child: CircularProgressIndicator(), ), ), … Why is it not… Read More Initializing state of late variables in flutter