flutter passing multiple data with getx

生来就可爱ヽ(ⅴ<●) 提交于 2020-12-27 06:35:46

问题


I want to Pass multiple data from one screen to another screen with Get package.

Get.to(Second(), arguments: ["First data", "Second data"]);

回答1:


Step: 1 : Sending data

Get.to(Second(), arguments: ["First data", "Second data"]);

Step: 2 : Get data From first screen

var data = Get.arguments;



回答2:


I found this solution.

First screen

 Get.to(Second(), arguments: ["First data", "Second data"]);

Second screen

Declare variable (list)

    var one = Get.arguments;

Set data

Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text("${one[0]}"), // first element set here
          Text("${one[1]}"), // second element set here
        ],
      )


来源:https://stackoverflow.com/questions/64906620/flutter-passing-multiple-data-with-getx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!