title: The relevant error-causing widget was Scaffold
body: <pre><code>class _NavBarState extends State&lt;NavBar&gt; {
    int _currentIndex = 0;
    final List&lt;Widget&gt; _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(
                icon: Icon(
                  Icons.search,
                ),
                label: 'Search',
                backgroundColor: Colors.black),
            BottomNavigationBarItem(
                icon: Icon(
                  Icons.favorite,
                ),
                label: 'Favorites',
                backgroundColor: Colors.black),
            BottomNavigationBarItem(
                icon: Icon(
                  Icons.notifications,
                ),
                label: 'Notifications',
                backgroundColor: Colors.black),
            BottomNavigationBarItem(
                icon: Icon(
                  Icons.more,
                ),
                label: 'More',
                backgroundColor: Colors.black),
          ],
          selectedItemColor: Color(0xffFFDA3A),
        ),
      );
    }
  }
  </code></pre>
  <p>'package:flutter/src/widgets/framework.dart': Failed assertion: line 4345 pos 14: 'owner._debugCurrentBuildTarget == this': is not true.
  The relevant error-causing widget was
  Scaffold</p>
  <p>Why am I getting this error?</p>
  <p><a href="https://i.stack.imgur.com/6kzcz.png" rel="nofollow noreferrer">link to the error</a></p>