Back button of other pages navigate to home

This commit is contained in:
fhkhd
2024-04-20 22:16:35 +04:30
parent 34e3f76845
commit c99cf569cf
20 changed files with 1455 additions and 1279 deletions
+10 -7
View File
@@ -115,13 +115,16 @@ class _ItemAddScreenState extends State<ItemAddScreen> {
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
final itemProviderObject = Provider.of<ItemProvider>(context);
return WillPopScope(
onWillPop: () async {
Navigator.pushReplacementNamed(
context,
Routes.itemResultScreen,
);
return true;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.itemResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(