mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 03:38:55 +03:30
Set condition for transfer my items
This commit is contained in:
@@ -355,52 +355,57 @@ class MyItemsDetailsDataBox extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if(datas.filePath!.isNotEmpty) Divider(),
|
if (datas.filePath!.isNotEmpty) Divider(),
|
||||||
if(datas.filePath!.isNotEmpty) SizedBox(
|
if (datas.filePath!.isNotEmpty)
|
||||||
height: 10,
|
SizedBox(
|
||||||
),
|
height: 10,
|
||||||
if(datas.filePath!.isNotEmpty) Container(
|
),
|
||||||
width: double.infinity,
|
if (datas.filePath!.isNotEmpty)
|
||||||
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
|
Container(
|
||||||
child: CarouselSlider.builder(
|
width: double.infinity,
|
||||||
disableGesture: true,
|
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
|
||||||
itemBuilder: (ctx, index, realIndex) {
|
child: CarouselSlider.builder(
|
||||||
return InkWell(
|
disableGesture: true,
|
||||||
child: Image(
|
itemBuilder: (ctx, index, realIndex) {
|
||||||
image: NetworkImage(datas.filePath![index])
|
return InkWell(
|
||||||
),
|
child: Image(
|
||||||
onTap: () {
|
image: NetworkImage(datas.filePath![index])),
|
||||||
showDialog(
|
onTap: () {
|
||||||
context: context,
|
showDialog(
|
||||||
builder: (BuildContext context) => PinchZoom(
|
context: context,
|
||||||
child: Image.network(datas.filePath![index])
|
builder: (BuildContext context) => PinchZoom(
|
||||||
),
|
child: Image.network(datas.filePath![index])),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: datas.filePath!.length,
|
itemCount: datas.filePath!.length,
|
||||||
options: CarouselOptions(
|
options: CarouselOptions(
|
||||||
enlargeCenterPage: true,
|
enlargeCenterPage: true,
|
||||||
aspectRatio: 16/8,
|
aspectRatio: 16 / 8,
|
||||||
viewportFraction: datas.filePath?.length == 1 ? 1 : 0.6,
|
viewportFraction: datas.filePath?.length == 1 ? 1 : 0.6,
|
||||||
padEnds: false,
|
padEnds: false,
|
||||||
pauseAutoPlayOnTouch: true,
|
pauseAutoPlayOnTouch: true,
|
||||||
disableCenter: false,
|
disableCenter: false,
|
||||||
autoPlay: false,
|
autoPlay: false,
|
||||||
enlargeFactor: 0.5,
|
enlargeFactor: 0.5,
|
||||||
enableInfiniteScroll:
|
enableInfiniteScroll:
|
||||||
datas.filePath?.length == 1 ? false : true,
|
datas.filePath?.length == 1 ? false : true,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
userData['roles']?.contains('Admin') ?? false
|
(userData['roles']?.contains('Admin') ||
|
||||||
|
(userData['roles']?.contains('Supervisor') &&
|
||||||
|
datas.packageId == null &&
|
||||||
|
datas.hospital.contains(userData['medical_center'])) ||
|
||||||
|
(userData['roles']?.contains('User') &&
|
||||||
|
datas.packageId == null))
|
||||||
? TransferDestroyButton(
|
? TransferDestroyButton(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
firstColor: kDarkBlue,
|
firstColor: kDarkBlue,
|
||||||
@@ -424,7 +429,9 @@ class MyItemsDetailsDataBox extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.0,
|
height: 10.0,
|
||||||
),
|
),
|
||||||
userData['roles']?.contains('Admin') ?? false
|
(userData['roles']?.contains('Admin') ||
|
||||||
|
(userData['roles']?.contains('Supervisor') &&
|
||||||
|
datas.status != 1))
|
||||||
? TransferDestroyButton(
|
? TransferDestroyButton(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
firstColor: kPink,
|
firstColor: kPink,
|
||||||
@@ -576,7 +583,8 @@ class MyItemsDetailsDataBox extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.0,
|
height: 10.0,
|
||||||
),
|
),
|
||||||
userData['roles']?.contains('Admin') ?? false
|
(userData['roles']?.contains('Admin') ||
|
||||||
|
userData['roles']?.contains('Supervisor'))
|
||||||
? TransferDestroyButton(
|
? TransferDestroyButton(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
firstColor: Colors.black,
|
firstColor: Colors.black,
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class MyItemsItemDataBox extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (isAdmin)
|
if (isAdmin)
|
||||||
Container(
|
Container(
|
||||||
width: 30 * _deviceBlockSize,
|
width: 50 * _deviceBlockSize,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user