Improve navigation back

This commit is contained in:
fhkhd
2024-03-13 19:20:21 +03:30
parent 3db8ae3cfe
commit 92e02cc84e
10 changed files with 308 additions and 284 deletions
@@ -337,80 +337,78 @@ class MyPackageDetailsDataBox extends StatelessWidget {
SizedBox(
height: 10.0,
),
userData['roles']?.contains('User') ?? false
? Container()
: TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kPink,
secondColor: kPinkSub,
text: 'Back Items to Item List',
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Are you sure to destroy this Package?',
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kPink,
secondColor: kPinkSub,
text: 'Back Items to Item List',
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Are you sure to destroy this Package?',
style: TextStyle(
fontSize: 4 * _deviceBlockSize,
),
),
content: SizedBox(
width: _deviceBlockSize,
height: 220,
child: Column(
children: [
Text(
'By approving, your package will be removed and it can not be used any more.',
style: TextStyle(
fontSize: 4 * _deviceBlockSize,
fontSize: 3 * _deviceBlockSize,
),
),
content: SizedBox(
width: _deviceBlockSize,
height: 220,
child: Column(
children: [
Text(
'By approving, your package will be removed and it can not be used any more.',
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
),
),
SizedBox(
height: 10.0,
),
PackageCard(_deviceBlockSize),
SizedBox(
height: 20.0,
),
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kPink,
secondColor: kPinkSub,
onTap: () {
Provider.of<PackageProvider>(context,
listen: false)
.removePackages(datas.id)
.then(
(value) {
Navigator.of(context).pop();
Navigator.pushReplacementNamed(
context,
Routes.myPackagesResultScreen,
);
},
);
},
text: 'Destroy',
),
SizedBox(
height: 5.0,
),
CancelTransferButton(
deviceBlockSize: _deviceBlockSize,
color: kDarkPurple,
onTap: () {
Navigator.pop(context);
},
),
],
),
SizedBox(
height: 10.0,
),
);
},
);
},
),
PackageCard(_deviceBlockSize),
SizedBox(
height: 20.0,
),
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kPink,
secondColor: kPinkSub,
onTap: () {
Provider.of<PackageProvider>(context,
listen: false)
.removePackages(datas.id)
.then(
(value) {
Navigator.of(context).pop();
Navigator.pushReplacementNamed(
context,
Routes.myPackagesResultScreen,
);
},
);
},
text: 'Destroy',
),
SizedBox(
height: 5.0,
),
CancelTransferButton(
deviceBlockSize: _deviceBlockSize,
color: kDarkPurple,
onTap: () {
Navigator.pop(context);
},
),
],
),
),
);
},
);
},
),
SizedBox(
height: 20,
),