Home > Mobile >  cannot navigate next page
cannot navigate next page

Time:04-05

Does anyone know why my navigation page isnt working after I click the icon Parking which will lead me to other pages which will display an appbar.

coding for navigate to parking screen

Inside parking_screen.dart, I called the app_bar_parking function

Details for my appbar

CodePudding user response:

I can not test your code but I think this happens because you are trying to navigate between two different app roots. Try removing the MaterialApp widget from your "parkingscreen.dart" file. Keep only the Scaffold widget since it contains all material components for you to work. Let me know if it works!

CodePudding user response:

Please have this kind of code in your ParkingScreen.dart file

 class ParkingScreen extends StatelessWidget {
  const ParkingScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Parking Screen')),
      body: SafeArea(child: Column()),
    );
  }
}

This happens because you are trying to navigate between two different app roots

  • Related