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