skip to Main Content

Context: I’m creating an app for sales and when I’m on the sales screen I have a button (Add item), this button takes me to the items grid.

my difficulty is turning on the sales screen with the selected item.

onTap: () => isSelecting ? Navigator.of(context).pop() : null,

2

Answers


  1. Chosen as BEST ANSWER
    onPressed: () async {
                         newProduto = await Navigator.of(context).push(MaterialPageRoute(builder: (context) => ProdutosPage(selecting: true)));
                         setState(() {
                           produtos.add(newProduto);
                         });
                        }
    

  2. You can use this

    Navigator.pop(context, yourObject);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search