mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 18:58:55 +03:30
Remove change status of package in result page
This commit is contained in:
@@ -174,172 +174,6 @@ class PackageItemBox extends StatelessWidget {
|
|||||||
color: Colors.black,
|
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(
|
SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user