mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-11 01:08:56 +03:30
Fix null items in add package
This commit is contained in:
+20
-25
@@ -129,6 +129,7 @@ class PackageProvider extends ChangeNotifier {
|
||||
),
|
||||
);
|
||||
}
|
||||
if (result.isEmpty) result.add("");
|
||||
itemVals = result;
|
||||
initialItemValue = itemVals[0];
|
||||
TextEditingController newLbl = new TextEditingController();
|
||||
@@ -248,24 +249,22 @@ class PackageProvider extends ChangeNotifier {
|
||||
items = [];
|
||||
searchBoxValue = value;
|
||||
originalItems!.forEach((result) {
|
||||
if (
|
||||
result.id
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(searchBoxValue.toLowerCase()) ||
|
||||
result.id
|
||||
.toString()
|
||||
.toUpperCase()
|
||||
.contains(searchBoxValue.toUpperCase()) ||
|
||||
result.id
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(searchBoxValue.toUpperCase()) ||
|
||||
result.id
|
||||
.toString()
|
||||
.toUpperCase()
|
||||
.contains(searchBoxValue.toLowerCase())
|
||||
) {
|
||||
if (result.id
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(searchBoxValue.toLowerCase()) ||
|
||||
result.id
|
||||
.toString()
|
||||
.toUpperCase()
|
||||
.contains(searchBoxValue.toUpperCase()) ||
|
||||
result.id
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(searchBoxValue.toUpperCase()) ||
|
||||
result.id
|
||||
.toString()
|
||||
.toUpperCase()
|
||||
.contains(searchBoxValue.toLowerCase())) {
|
||||
items!.add(result);
|
||||
}
|
||||
});
|
||||
@@ -334,12 +333,11 @@ class PackageProvider extends ChangeNotifier {
|
||||
}
|
||||
var data = json.decode(response.body)['data'];
|
||||
List<String> itemsList = [];
|
||||
if(data['items'] != null){
|
||||
if (data['items'] != null) {
|
||||
for (var item in data['items']) {
|
||||
// itemsList
|
||||
// .add("${item['name']} - ${item['udi'] != null ? item['udi'] : ''}");
|
||||
itemsList
|
||||
.add("${item['id']} ${item['name']}");
|
||||
itemsList.add("${item['id']} ${item['name']}");
|
||||
}
|
||||
}
|
||||
print(data);
|
||||
@@ -362,10 +360,7 @@ class PackageProvider extends ChangeNotifier {
|
||||
final baseStorage = await getExternalStorageDirectory();
|
||||
final taskId = await FlutterDownloader.enqueue(
|
||||
url: Url.exportPackages,
|
||||
headers: {
|
||||
'Authorization': User.token,
|
||||
"Accept": "*"
|
||||
},
|
||||
headers: {'Authorization': User.token, "Accept": "*"},
|
||||
savedDir: baseStorage!.path,
|
||||
showNotification: true,
|
||||
openFileFromNotification: true,
|
||||
|
||||
Reference in New Issue
Block a user