mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 18:19:03 +03:30
Add "there is no item to other screens"
This commit is contained in:
@@ -11,6 +11,7 @@ import 'package:provider/provider.dart';
|
|||||||
|
|
||||||
class MyItemsRequestsScreen extends StatefulWidget {
|
class MyItemsRequestsScreen extends StatefulWidget {
|
||||||
final bool? isAdmin;
|
final bool? isAdmin;
|
||||||
|
|
||||||
const MyItemsRequestsScreen({
|
const MyItemsRequestsScreen({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.isAdmin,
|
this.isAdmin,
|
||||||
@@ -93,13 +94,14 @@ class _MyItemsRequestsScreenState extends State<MyItemsRequestsScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: itemResults.myItems?.length != null
|
||||||
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return RequestsDataBox(
|
return RequestsDataBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
isAdmin:
|
isAdmin: userData['roles']
|
||||||
userData['roles']?.contains('User')
|
?.contains('User')
|
||||||
? false
|
? false
|
||||||
: true,
|
: true,
|
||||||
item: itemResults
|
item: itemResults
|
||||||
@@ -109,6 +111,12 @@ class _MyItemsRequestsScreenState extends State<MyItemsRequestsScreen> {
|
|||||||
itemCount: itemResults
|
itemCount: itemResults
|
||||||
.originalMyItemsRequests?.length,
|
.originalMyItemsRequests?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Center(
|
||||||
|
child:
|
||||||
|
Text("There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -149,15 +149,18 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: userResults.usersBox?.length != null
|
||||||
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return TransferDataBox(
|
return TransferDataBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize:
|
||||||
user: userResults.usersBox?[index],
|
_deviceBlockSize,
|
||||||
|
user: userResults
|
||||||
|
.usersBox?[index],
|
||||||
clickColor: kDarkBlue,
|
clickColor: kDarkBlue,
|
||||||
isClicked:
|
isClicked: userResults
|
||||||
userResults.selectedUserIndex ==
|
.selectedUserIndex ==
|
||||||
index,
|
index,
|
||||||
onTap: (userId) {
|
onTap: (userId) {
|
||||||
Provider.of<UsersProvider>(
|
Provider.of<UsersProvider>(
|
||||||
@@ -173,12 +176,20 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
|||||||
context,
|
context,
|
||||||
listen: false)
|
listen: false)
|
||||||
.selectedUserForItems =
|
.selectedUserForItems =
|
||||||
userResults.usersBox?[index];
|
userResults
|
||||||
|
.usersBox?[index];
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: userResults.usersBox?.length,
|
itemCount:
|
||||||
|
userResults.usersBox?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"There is no user to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -265,9 +276,12 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
|||||||
myItemProvider
|
myItemProvider
|
||||||
.resetLoadingButton();
|
.resetLoadingButton();
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg: "The item is transferred.",
|
msg:
|
||||||
toastLength: Toast.LENGTH_SHORT,
|
"The item is transferred.",
|
||||||
gravity: ToastGravity.BOTTOM,
|
toastLength:
|
||||||
|
Toast.LENGTH_SHORT,
|
||||||
|
gravity:
|
||||||
|
ToastGravity.BOTTOM,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
text: 'Transfer',
|
text: 'Transfer',
|
||||||
|
|||||||
@@ -94,22 +94,30 @@ class _MyPackagesRequestsScreenState extends State<MyPackagesRequestsScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: packageResults.myPackages?.length != null
|
||||||
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return PackageRequestsDataBox(
|
return PackageRequestsDataBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
isAdmin:
|
isAdmin: userData['roles']
|
||||||
userData['roles']?.contains('User')
|
?.contains('User')
|
||||||
? false
|
? false
|
||||||
: true,
|
: true,
|
||||||
package: packageResults
|
package: packageResults
|
||||||
.originalMyPackagesRequests?[index],
|
.originalMyPackagesRequests?[
|
||||||
|
index],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: packageResults
|
itemCount: packageResults
|
||||||
.originalMyPackagesRequests?.length,
|
.originalMyPackagesRequests?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Center(
|
||||||
|
child:
|
||||||
|
Text("There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -77,7 +77,12 @@ class _TestVerifyScreenState extends State<TestVerifyScreen> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
titleSpacing: -10,
|
titleSpacing: -10,
|
||||||
title: Text('Home', style: TextStyle(color: Colors.white,),),
|
title: Text(
|
||||||
|
'Home',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
@@ -231,11 +236,12 @@ class _TestVerifyScreenState extends State<TestVerifyScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: testResults.items?.length != null ?
|
: testResults.items?.length != null
|
||||||
ListView.builder(
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) =>
|
itemBuilder: (context, index) =>
|
||||||
(testResults.items![index].verified == 'None' &&
|
(testResults.items![index].verified ==
|
||||||
|
'None' &&
|
||||||
userData['roles']
|
userData['roles']
|
||||||
.contains('Supervisor')) ||
|
.contains('Supervisor')) ||
|
||||||
userData['roles'].contains('Admin')
|
userData['roles'].contains('Admin')
|
||||||
@@ -248,8 +254,8 @@ class _TestVerifyScreenState extends State<TestVerifyScreen> {
|
|||||||
: Container(),
|
: Container(),
|
||||||
itemCount: testResults.items?.length,
|
itemCount: testResults.items?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
) :
|
)
|
||||||
Container(
|
: Container(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text("There is no item to show."),
|
child: Text("There is no item to show."),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user