I've been facing this problem for a lot of time now, i tried looking into most guides and followed their steps but still no use. Whenever I click on any navigation icon the page freezes for a second and then nothing happened. If i continue clicking on other icons the whole app crashes. I don't really know what's the problem here? This is what I get in the debug console:

═╡ EXCEPTION CAUGHT BY RENDERING LIBRARY╞═════════════════════════════════════════════════════════ The following assertion was thrown during performLayout(): RenderCustomMultiChildLayoutBox object was given an infinite size during layout. This probably means that it is a render object that tries to be as big as possible, but it was put inside another render object that allows its children to pick their own size. The nearest ancestor providing an unbounded height constraint is: _RenderSingleChildViewport#0201e relayoutBoundary=up13 NEEDS-LAYOUT: needs compositing creator: _SingleChildViewport ← IgnorePointer-[GlobalKey#f6907] ← Semantics ← Listener ← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey#32a91] ← Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#aa9b9] ← NotificationListener ← RepaintBoundary ← CustomPaint-[GlobalKey#16ec7] ← ⋯ parentData: (can use size) constraints: BoxConstraints(0.0<=w<=742.0, 0.0<=h<=847.0) layer: OffsetLayer#006ed size: Size(742.0, 847.0) offset: Offset(0.0, -0.0) The constraints that applied to the RenderCustomMultiChildLayoutBox were: BoxConstraints(0.0<=w<=742.0, 0.0<=h<=Infinity) The exact size it was given was: Size(742.0, Infinity) See https://flutter.dev/docs/development/ui/layout/box-constraints for more information.

The following error appears whenever i try to navigate to the AddMentor class/page. Also every time I run the app it gets crashed so i changed my first index to another class. it's supposed to be the current one (below code). If the AddMentor class code is needed i will post it

import 'package:flutter/material.dart';
import 'package:senior_app/view/addMentor.dart';
import 'package:senior_app/view/dahsboardScreen.dart';
import 'package:senior_app/view/loginScreen.dart';
import 'package:senior_app/view/changeEmailScreen.dart';
import 'package:senior_app/view/changePasswordScreen.dart';
import 'package:senior_app/view/contactScreen.dart';
import 'package:senior_app/view/policyScreen.dart';
import 'package:senior_app/view/searchScreen.dart';
import 'package:senior_app/view/traineeInfoScreen.dart';
import 'package:senior_app/view/traineeRegistrationScreen.dart';

class traineeProfileScreen extends StatefulWidget {
  const traineeProfileScreen({
    Key? key,
  }) : super(key: key);

  @override
  State<traineeProfileScreen> createState() => _MyStatefulWidgetState();
}

class _MyStatefulWidgetState extends State<traineeProfileScreen> {
  int _currentIndex = 0;
List<Widget> bodys = const[
     const dashboardScreen(),

  const traineeProfileScreen(),
    const searchScreen(),
    const addMentor()

];
  _MyStatefulWidgetState() : super();
  void _onItemTapped(int index) {
    setState(() {
      _currentIndex = index;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      appBar: appBar(),
      endDrawer: drawer(),
      body: body(),
      bottomNavigationBar: BottomNavigationBar(
      currentIndex: _currentIndex,
        onTap: (int newIndex){
          setState(() {
            _currentIndex = newIndex;
          });
        },

        items: const [
          BottomNavigationBarItem(
            icon: Icon(
              Icons.home,
              color: Colors.grey,
            ),
            label: 'Home',
            backgroundColor: Colors.white,
          ),
          BottomNavigationBarItem(
            icon: Icon(
              Icons.dashboard,
              color: Colors.grey,
            ),
            label: 'Dashboard',
            backgroundColor: Colors.white,
          ),
          BottomNavigationBarItem(
            icon: Icon(
              Icons.search,
              color: Colors.grey,
            ),
            label: 'Search',
            backgroundColor: Colors.white,
          ),
          BottomNavigationBarItem(
            icon: Icon(
              Icons.person,
              color: Colors.grey,
            ),
            label: 'Profile',
            backgroundColor: Colors.white,
          ),
        ],
        selectedItemColor: Colors.amber[800],
      ),
    );
  }

  SingleChildScrollView body() {
    return SingleChildScrollView(
      child: SafeArea(
        child:           
Column(
          verticalDirection: VerticalDirection.down,
          // ignore: prefer_const_literals_to_create_immutables
          children: [
            const CircleAvatar(
              radius: 80,
              backgroundImage: AssetImage('images/avatar.png'),
            ),
            Text(
              traineeInfoScreen.name,
              style: TextStyle(
                fontSize: 20,
                color: Colors.black,
              ),
            ),
            const SizedBox(
              height: 50,
            ),
            // ******************** Public Info ********************//
            Container(
              alignment: Alignment.topLeft,
              margin: EdgeInsets.fromLTRB(100, 0, 0, 0),
              child: const Text(
                "Public Information",
                style: TextStyle(
                    fontSize: 20,
                    color: Colors.green,
                    fontWeight: FontWeight.normal),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.abc,
                ),
                title: Text(traineeInfoScreen.name),
                subtitle: Text("name"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.phone,
                ),
                title: Text(traineeInfoScreen.phone),
                subtitle: Text("phone number"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.email,
                ),
                title: Text(traineeRegistrationScreen.email),
                subtitle: Text("email"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.work,
                ),
                title: Text(traineeInfoScreen.major),
                subtitle: Text("major"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.work,
                ),
                title: Text(traineeInfoScreen.skills),
                subtitle: Text("skills"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.home,
                ),
                title: Text(traineeInfoScreen.instituation),
                subtitle: Text("current instituation"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.person,
                ),
                title: Text(traineeInfoScreen.gender),
                subtitle: Text("gender"),
                trailing: IconButton(
                  onPressed: () {
                    Icon(Icons.abc);
                  },
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            // ******************** Private Info ********************//
            Container(
              alignment: Alignment.topLeft,
              margin: EdgeInsets.fromLTRB(100, 0, 0, 0),
              child: const Text(
                "Private Information",
                style: TextStyle(
                    fontSize: 20,
                    color: Colors.red,
                    fontWeight: FontWeight.normal),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.person,
                ),
                title: Text(traineeInfoScreen.name),
                subtitle: Text("full name"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.flag,
                ),
                title: Text(traineeInfoScreen.nationality),
                subtitle: Text("nationality"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.date_range,
                ),
                title: Text(traineeInfoScreen.age),
                subtitle: Text("DOB"),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.school,
                ),
                title: Text(traineeInfoScreen.address),
                subtitle: Text("address"),
                trailing: IconButton(
                  onPressed: () {
                    Icon(Icons.abc);
                  },
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.card_membership,
                ),
                title: Text("ID"),
                subtitle: traineeInfoScreen.image1 != null
                    ? Container(
                        height: 200,
                        width: 200,
                        child: traineeInfoScreen.image1,
                      )
                    : Text(
                        "No Image",
                        style: TextStyle(fontSize: 20),
                      ),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.card_travel,
                ),
                title: Text("Passport"),
                subtitle: traineeInfoScreen.image2 != null
                    ? Container(
                        height: 200,
                        width: 200,
                        child: traineeInfoScreen.image2,
                      )
                    : Text(
                        "No Image",
                        style: TextStyle(fontSize: 20),
                      ),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),
            Card(
              color: Colors.white,
              margin: EdgeInsets.fromLTRB(100, 10, 100, 10),
              child: ListTile(
                leading: Icon(
                  Icons.card_giftcard,
                ),
                title: Text("License"),
                subtitle: traineeInfoScreen.image3 != null
                    ? Container(
                        height: 200,
                        width: 200,
                        child: traineeInfoScreen.image3,
                      )
                    : Text(
                        "No Image",
                        style: TextStyle(fontSize: 20),
                      ),
                trailing: IconButton(
                  onPressed: () {},
                  icon: Icon(Icons.edit_outlined),
                ),
              ),
            ),           
        bodys[_currentIndex],

          ],

        ),
      ),

    );
    //bottomNavigationBar: BottomNavigationBar(
      //   currentIndex: _currentIndex,
      //   onTap: (int newIndex){
      //     setState(() {
      //     _currentIndex - newIndex;
      //     });
      //   }, items: const [
      //     BottomNavigationBarItem(label: 'home',icon: Icon(Icons.home),),
      //               BottomNavigationBarItem(label: 'Menu',icon: Icon(Icons.menu),),

      //     BottomNavigationBarItem(label: 'Profile',icon: Icon(Icons.person),),

      //   ],
      // )
  }
}