This commit is contained in:
unknown
2023-12-11 22:29:06 +03:30
parent ede10a2efe
commit 1342b9f2e1
11 changed files with 157 additions and 82 deletions
@@ -117,67 +117,6 @@ class ItemItemBox extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
userData['roles']?.contains('User') ?? false
? Container()
: InkWell(
customBorder: CircleBorder(),
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
item!.status == 1
? 'Are you Reject this item?'
: 'Are you Confirm this item?',
),
actions: <Widget>[
TextButton(
onPressed: () {
Provider.of<ItemProvider>(context,
listen: false)
.changeStatus(item!.id)
.then(
(value) {
if (value) {
print('true');
}
Navigator.of(context)
.popAndPushNamed(Routes
.itemResultScreen);
},
);
},
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: item!.status == 1 ? kPink : kBlue,
),
child: Icon(
item!.status == 1 ? Icons.close : Icons.check,
size: 4 * _deviceBlockSize,
color: Colors.white,
),
),
),
SizedBox(
width: 5.0,
),
// userData['roles']?.contains('User') ?? false
// ? Container()
// : InkWell(
@@ -278,6 +217,67 @@ class ItemItemBox extends StatelessWidget {
SizedBox(
width: 5.0,
),
userData['roles']?.contains('User') ?? false
? Container()
: InkWell(
customBorder: CircleBorder(),
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
item!.status == 1
? 'Are you Reject this item?'
: 'Are you Confirm this item?',
),
actions: <Widget>[
TextButton(
onPressed: () {
Provider.of<ItemProvider>(context,
listen: false)
.changeStatus(item!.id)
.then(
(value) {
if (value) {
print('true');
}
Navigator.of(context)
.popAndPushNamed(Routes
.itemResultScreen);
},
);
},
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: item!.status == 1 ? kPink : kBlue,
),
child: Icon(
item!.status == 1 ? Icons.close : Icons.check,
size: 4 * _deviceBlockSize,
color: Colors.white,
),
),
),
SizedBox(
width: 5.0,
),
InkWell(
customBorder: CircleBorder(),
onTap: () {