I am using arguments
method in Navigator
to pass a List
Navigator.pushNamed(context, '/cam', arguments: {'label' : list});
list
is a string of items separated by comma for eg: item1, item2
and on receiving the the map of data from the first screen in second screen, I store that in a List by
data = ModalRoute.of(context).settings.arguments;
print(data);
rekognition.add(data['label']);
print(rekognition);
under Widget build and the above print statements prints [null, item1, item2
] and [null, item1, item2, null, item1, item2]
respectively.
this is where the problem is I don't why null
pop up here and the list adds all the items second time
also
for (x=0; x<ing.length; x++) {
list = '$list , ${ing[x]}';
}
ing
is again a list and its equal to List<dynamic>();
all I wanted to do was send a list of items which is added in the first screen and or else a empty list to the second screen and add all those received data to another variable in second screen and do object detection and add the label to the list of items that was passed form the first screen and go back to the first screen again with data of the all the list items including the data that was passed and added
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…