mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 19:38:55 +03:30
Set 'There is no item to show' to all menu screens
This commit is contained in:
@@ -198,7 +198,9 @@ class _CycleResultScreenState extends State<CycleResultScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
:
|
||||||
|
cycleResults.items?.length != null ?
|
||||||
|
ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
String labels = '';
|
String labels = '';
|
||||||
@@ -221,6 +223,11 @@ class _CycleResultScreenState extends State<CycleResultScreen> {
|
|||||||
},
|
},
|
||||||
itemCount: cycleResults.items?.length,
|
itemCount: cycleResults.items?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
) :
|
||||||
|
Container(
|
||||||
|
child: Center(
|
||||||
|
child: Text("There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -251,7 +251,8 @@ class _ItemResultScreenState extends State<ItemResultScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: itemResults.items?.length != null ?
|
||||||
|
ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
// remove extra ,
|
// remove extra ,
|
||||||
@@ -262,6 +263,11 @@ class _ItemResultScreenState extends State<ItemResultScreen> {
|
|||||||
},
|
},
|
||||||
itemCount: itemResults.items?.length,
|
itemCount: itemResults.items?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
) :
|
||||||
|
Container(
|
||||||
|
child: Center(
|
||||||
|
child: Text("There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -72,7 +72,12 @@ class _LabelResultScreenState extends State<LabelResultScreen> {
|
|||||||
),
|
),
|
||||||
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(
|
||||||
@@ -171,15 +176,23 @@ class _LabelResultScreenState extends State<LabelResultScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: labelResults.items?.length != null
|
||||||
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) =>
|
itemBuilder: (context, index) =>
|
||||||
LabelItemBox(
|
LabelItemBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
item: labelResults.items?[index],
|
item: labelResults.items?[index],
|
||||||
),
|
),
|
||||||
itemCount: labelResults.items?.length,
|
itemCount:
|
||||||
|
labelResults.items?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:provider/provider.dart';
|
|||||||
|
|
||||||
class MyItemsMineScreen extends StatefulWidget {
|
class MyItemsMineScreen extends StatefulWidget {
|
||||||
final bool? isAdmin;
|
final bool? isAdmin;
|
||||||
|
|
||||||
const MyItemsMineScreen({
|
const MyItemsMineScreen({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.isAdmin,
|
this.isAdmin,
|
||||||
@@ -174,26 +175,33 @@ class _MyItemsMineScreenState extends State<MyItemsMineScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: itemResults.originalMyItems?.length != null
|
||||||
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return MyItemsItemDataBox(
|
return MyItemsItemDataBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
isAdmin:
|
isAdmin: userData['roles']
|
||||||
userData['roles']?.contains('User')
|
?.contains('User')
|
||||||
? false
|
? false
|
||||||
: true,
|
: true,
|
||||||
items: itemResults.myItems?[index],
|
items: itemResults.myItems?[index],
|
||||||
push: () {
|
push: () {
|
||||||
Navigator.pushNamed(context,
|
Navigator.pushNamed(context,
|
||||||
Routes.myItemsHistoryScreen,
|
Routes.myItemsHistoryScreen,
|
||||||
arguments:
|
arguments: itemResults
|
||||||
itemResults.myItems?[index]);
|
.myItems?[index]);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: itemResults.myItems?.length,
|
itemCount: itemResults.myItems?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Center(
|
||||||
|
child:
|
||||||
|
Text("There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||||
import 'package:cssd/config/routes.dart';
|
import 'package:cssd/config/routes.dart';
|
||||||
import 'package:cssd/providers/auth.dart';
|
import 'package:cssd/providers/auth.dart';
|
||||||
@@ -147,13 +146,15 @@ class _MyPackagesMineScreenState extends State<MyPackagesMineScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: packageResults.originalMyPackages?.length !=
|
||||||
|
null
|
||||||
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return MyPackagesItemDataBox(
|
return MyPackagesItemDataBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
isAdmin:
|
isAdmin: userData['roles']
|
||||||
userData['roles']?.contains('User')
|
?.contains('User')
|
||||||
? false
|
? false
|
||||||
: true,
|
: true,
|
||||||
packages:
|
packages:
|
||||||
@@ -166,8 +167,14 @@ class _MyPackagesMineScreenState extends State<MyPackagesMineScreen> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: packageResults.myPackages?.length,
|
itemCount:
|
||||||
|
packageResults.myPackages?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Text("There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
sc = new ScrollController();
|
sc = new ScrollController();
|
||||||
super.initState();
|
super.initState();
|
||||||
IsolateNameServer.registerPortWithName(_port.sendPort, 'downloader_send_port');
|
IsolateNameServer.registerPortWithName(
|
||||||
|
_port.sendPort, 'downloader_send_port');
|
||||||
_port.listen((dynamic data) {
|
_port.listen((dynamic data) {
|
||||||
String id = data[0];
|
String id = data[0];
|
||||||
DownloadTaskStatus status = data[1];
|
DownloadTaskStatus status = data[1];
|
||||||
@@ -55,7 +56,8 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
|
|||||||
|
|
||||||
@pragma('vm:entry-point')
|
@pragma('vm:entry-point')
|
||||||
static void downloadCallback(String id, int status, int progress) {
|
static void downloadCallback(String id, int status, int progress) {
|
||||||
final SendPort? send = IsolateNameServer.lookupPortByName('downloader_send_port');
|
final SendPort? send =
|
||||||
|
IsolateNameServer.lookupPortByName('downloader_send_port');
|
||||||
send!.send([id, status, progress]);
|
send!.send([id, status, progress]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +109,12 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
|
|||||||
),
|
),
|
||||||
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(
|
||||||
@@ -209,7 +216,8 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: packageResults.items?.length != null
|
||||||
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
// String items = '';
|
// String items = '';
|
||||||
@@ -224,11 +232,19 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
|
|||||||
// ); // remove extra ,
|
// ); // remove extra ,
|
||||||
return PackageItemBox(
|
return PackageItemBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
item: packageResults.items?[index],
|
item:
|
||||||
|
packageResults.items?[index],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
itemCount: packageResults.items?.length,
|
itemCount:
|
||||||
|
packageResults.items?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -266,7 +282,8 @@ class PackageResultFloatingButton extends StatelessWidget {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
var status = await Permission.storage.request();
|
var status = await Permission.storage.request();
|
||||||
if (status.isGranted) {
|
if (status.isGranted) {
|
||||||
Provider.of<PackageProvider>(context, listen: false).exportPackages();
|
Provider.of<PackageProvider>(context, listen: false)
|
||||||
|
.exportPackages();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|||||||
@@ -278,15 +278,23 @@ class _TestResultScreenState extends State<TestResultScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: testResults.items?.length != null
|
||||||
|
? ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) =>
|
itemBuilder: (context, index) =>
|
||||||
TestItemBox(
|
TestItemBox(
|
||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
item: testResults.items![index],
|
item: testResults.items![index],
|
||||||
),
|
),
|
||||||
itemCount: testResults.items?.length,
|
itemCount:
|
||||||
|
testResults.items?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -230,7 +230,8 @@ class _TestVerifyScreenState extends State<TestVerifyScreen> {
|
|||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: testResults.items?.length != null ?
|
||||||
|
ListView.builder(
|
||||||
controller: sc,
|
controller: sc,
|
||||||
itemBuilder: (context, index) =>
|
itemBuilder: (context, index) =>
|
||||||
(testResults.items![index].verified == 'None' &&
|
(testResults.items![index].verified == 'None' &&
|
||||||
@@ -246,6 +247,11 @@ class _TestVerifyScreenState extends State<TestVerifyScreen> {
|
|||||||
: Container(),
|
: Container(),
|
||||||
itemCount: testResults.items?.length,
|
itemCount: testResults.items?.length,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
) :
|
||||||
|
Container(
|
||||||
|
child: Center(
|
||||||
|
child: Text("There is no item to show."),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class MyPackagesItemDataBox 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