mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 01:58:56 +03:30
3.2.2
This commit is contained in:
@@ -163,14 +163,14 @@ class ItemItemBox extends StatelessWidget {
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(7),
|
||||
width: 6 * _deviceBlockSize,
|
||||
width: 8 * _deviceBlockSize,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: item!.status == 1 ? kPink : kBlue,
|
||||
),
|
||||
child: Icon(
|
||||
item!.status == 1 ? Icons.close : Icons.check,
|
||||
size: 2 * _deviceBlockSize,
|
||||
size: 4 * _deviceBlockSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
@@ -178,27 +178,26 @@ class ItemItemBox extends StatelessWidget {
|
||||
SizedBox(
|
||||
width: 5.0,
|
||||
),
|
||||
userData['roles']?.contains('User') ?? false
|
||||
? Container()
|
||||
: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
Routes.itemUpdateScreen,
|
||||
arguments: item!.id,
|
||||
);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
size: 5 * _deviceBlockSize,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 5.0,
|
||||
),
|
||||
userData['roles']?.contains('User') ?? false
|
||||
? Container()
|
||||
: InkWell(
|
||||
// userData['roles']?.contains('User') ?? false
|
||||
// ? Container()
|
||||
// : InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.of(context).pushNamed(
|
||||
// Routes.itemUpdateScreen,
|
||||
// arguments: item!.id,
|
||||
// );
|
||||
// },
|
||||
// child: Icon(
|
||||
// Icons.edit,
|
||||
// size: 5 * _deviceBlockSize,
|
||||
// color: Colors.black,
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// width: 5.0,
|
||||
// ),
|
||||
userData['roles']?.contains('Admin') ?? false
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
@@ -206,7 +205,7 @@ class ItemItemBox extends StatelessWidget {
|
||||
return AlertDialog(
|
||||
title: Text('Delete'),
|
||||
content: Text(
|
||||
'Are you sure you want delete this Item?'),
|
||||
'Are you sure you want delete this Item?',),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: Text('Yes'),
|
||||
@@ -233,7 +232,49 @@ class ItemItemBox extends StatelessWidget {
|
||||
size: 5 * _deviceBlockSize,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
)
|
||||
: userData['roles']?.contains('Supervisor')
|
||||
? item!.packageId != null
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text('Delete'),
|
||||
content: Text(
|
||||
'Are you sure you want delete this Item?',
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: Text('Yes'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
Provider.of<ItemProvider>(
|
||||
context,
|
||||
listen: false)
|
||||
.removeItems(item!.id);
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: Text('No'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
size: 5 * _deviceBlockSize,
|
||||
color: Colors.black,
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
: Container(),
|
||||
SizedBox(
|
||||
width: 5.0,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user