79233671

Date: 2024-11-28 11:27:54
Score: 2
Natty:
Report link

I Found this answer

Here is the correct way to receive the data from the previous screen

From Screen B

Navigator.pop(context,"Pass your data here");

In Screen A

String results;

var receiedValue =await Navigator.push(
              context,
              MaterialPageRoute(builder: (context) => ScreenB()),
            );
            // How do I refresh the widget here to fetch updated data?
           setState(){
          results = receiedValue;
            }
Reasons:
  • Blacklisted phrase (1): How do I
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Keshav Passi