Remove change status of package in result page

This commit is contained in:
fhkhd
2024-02-27 19:04:20 +03:30
parent 18f7d5a759
commit 1c226e89cc
@@ -174,172 +174,6 @@ class PackageItemBox extends StatelessWidget {
color: Colors.black,
),
),
item?.status == "suspended"
? Row(
children: [
SizedBox(
width: 5.0,
),
InkWell(
customBorder: CircleBorder(),
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Are you Reject this item?'),
actions: <Widget>[
Consumer<
PackageProvider>(
builder: (context,
packageProvider,
_) {
return packageProvider
.isloadingButton
? CircularProgressIndicator(
color: Colors
.black,
)
: TextButton(
onPressed:
() async {
packageProvider
.setLoadingButton();
await Provider.of<PackageProvider>(context,
listen: false)
.changeStatus(item!.id, "rejected")
.then(
(value) {
if (value) {
print('true');
}
Navigator.of(context).pop();
Navigator.of(context).popAndPushNamed(Routes.packageResultScreen);
Fluttertoast.showToast(
msg: "Package is Rejected.",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
);
packageProvider.resetLoadingButton();
},
);
},
child: Text(
'Yes'),
);
},
),
TextButton(
onPressed: () {
Navigator.of(
context)
.pop();
},
child: Text('No'),
),
],
);
},
);
},
child: Container(
padding: EdgeInsets.all(7),
width: 8 * _deviceBlockSize,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: kPink),
child: Icon(
Icons.close,
size: 4 * _deviceBlockSize,
color: Colors.white,
),
),
),
SizedBox(
width: 5,
),
InkWell(
customBorder: CircleBorder(),
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Are you Confirm this item?',
),
actions: <Widget>[
Consumer<
PackageProvider>(
builder: (context,
packageProvider,
_) {
return packageProvider
.isloadingButton
? CircularProgressIndicator(
color: Colors
.black,
)
: TextButton(
onPressed:
() async {
packageProvider
.setLoadingButton();
await Provider.of<PackageProvider>(context,
listen: false)
.changeStatus(item!.id, "approved")
.then(
(value) {
if (value) {
print('true');
}
Navigator.of(context).pop();
Navigator.of(context).popAndPushNamed(Routes.packageResultScreen);
Fluttertoast.showToast(
msg: "Package is Confirmed.",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
);
packageProvider.resetLoadingButton();
},
);
},
child: Text(
'Yes'),
);
},
),
TextButton(
onPressed: () {
Navigator.of(
context)
.pop();
},
child: Text('No'),
),
],
);
},
);
},
child: Container(
padding: EdgeInsets.all(7),
width: 8 * _deviceBlockSize,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: kBlue,
),
child: Icon(
Icons.check,
size: 4 * _deviceBlockSize,
color: Colors.white,
),
),
),
],
)
: Container(),
SizedBox(
width: 5,
),