I have navigate from Dashboard to Some Screen called 'A'. In that screen, I have shown a listing using ListView Builder. In that, clicking on item in ListView navigate to another Screen called "B". When I press back button in that Screen "B" its navigate to Dashboard. But it has to navigate to Screen "A". Please help me to resolve this issue.
In Dashboard, I have use below code to Navigate to Screen "A",
_showSnackBar(BuildContext context, Item item) {
switch(item.name)
{
case "Disputes":
Navigator.push(context, MaterialPageRoute(builder: (context)=> Disputes()));
break;
}
}
}
In Screen "A", I have use below code to Navigate to Screen "B",
Card(
child: ListTile(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
SubmitDisputes(disputesId: disputeResList[index].id.toString())));
},
trailing: Icon(
Icons.remove_red_eye),
));
}),
),
),
When I press back button in Screen "B", its navigate to Dashboard. But I need to navigate to "A" as per the backstacks.
Please help me!