The relevant error-causing widget was Scaffold
问题 class _NavBarState extends State<NavBar> { int _currentIndex = 0; final List<Widget> _children = [ HomeScreen(), SignUpScreen(), ForgetPassword(), LoginScreen(), ]; void onTappedBar(int index) { setState(() { _currentIndex = index; }); } @override Widget build(BuildContext context) { return Scaffold( body: _children[_currentIndex], bottomNavigationBar: BottomNavigationBar( onTap: onTappedBar, currentIndex: _currentIndex, type: BottomNavigationBarType.fixed, items: [ BottomNavigationBarItem(