问题
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