skip to Main Content

Flutter – How to add Navigator to bottomNavigationBar?

With the current code, on click of back button, the app exits instead of moving to the previous page. import 'package:curved_navigation_bar/curved_navigation_bar.dart'; class homeNav extends StatefulWidget { const homeNav({super.key}); @override State<homeNav> createState() => _homeNavState(); } class _homeNavState extends State<homeNav> { int…

VIEW QUESTION

I am passing anonymous function with Navigator.pushNamed in its body, but it is showing the error – setState() or markNeedsBuild() called during build – Flutter

This is the block of code causing error, if I remove Navigator.pushNamed from the function, no error occurs RoundedButton(buttonColor: Colors.lightBlueAccent,buttonText: 'Log In', onPress: (){Navigator.pushNamed(context, LoginScreen.id);}, <-- This line is causing error ), This is the code for RoundedButton class RoundedButton…

VIEW QUESTION

Flutter – GestureDetector – onTap: widget.press(), – final Function press;- Navigator.of(context).push();

This is my first page (RecomendsPlants) and I want to move to another page called (DetailsScreen) RecomendsPlants: // ignore_for_file: prefer_const_constructors import 'package:flutter/material.dart'; import 'package:mr_plants_store/constants.dart'; import 'package:mr_plants_store/screens/details/details_screen.dart'; class RecomendsPlants extends StatefulWidget { const RecomendsPlants({super.key}); @override State createState() => _RecomendsPlantsState(); } class…

VIEW QUESTION
Back To Top
Search