Home > Net >  How to return value when navigator to another page in Flutter?
How to return value when navigator to another page in Flutter?

Time:05-10

I have a code like this:

Navigator.push(context, MaterialPageRoute<String>(builder: (context) => bolatAktar_bolatAktar_filtrelemeSonucu()));

When going to the bolatAktar_bolatTransfer_filterlemeResult() page, I want to import data that I can use on that page. I will send a total of 2 data. One is double and the other is String type data. How can I do that?

Thanks in advance for your help.

CodePudding user response:

String? value = await Navigator.push<String>(
  context,
  MaterialPageRoute<String>(
    builder: (context) => bolatAktar_bolatAktar_filtrelemeSonucu(
      d: 0.0,
      s: ""
    )
  )
);
  • Related