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