please i am trying to pass to array data from one screen to another via route. bellow is my code. Thank you all.
class BallGamesWidget extends StatefulWidget {
@override
BallGamesWidgetState createState() => new BallGamesWidgetState();
}
class BallGamesWidgetState extends State {
Map<String, bool> List = {
'Bubble Football ⚽': false,
'Futsal ': false,
'Beach Volleyball ': false,
'Volleyball ': false,
'Dodgeball ': false,
'Rugby ': false,
'American Footbal ': false,
'Korftbal ': false,
'Netbal ⚾': false,
};
var holder_1 = [];
getItems() {
List.forEach((key, value) {
if (value == true) {
holder_1.add(key);
}
});
from my scrren one. i mapped through the List and stored the true value to holder_1
AppLargeButton(
text: "Next",
textColor: Colors.white,
backgroundColor: Colors.black,
onTap: () {
// getItems();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BallGamesSelectedItems(holder_1),
),
);
}),
then from the button, i am trying to use Navigator.push to push the holder_1 to my second scrren 'BallGamesSelectedItems()'
firstly, i dont know if i am right with usage of the Naviagtion.push and secondly, i dont know how to retrieve it back in my second screen. thanks