mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 00:38:54 +03:30
fix package detail bug
This commit is contained in:
@@ -17,6 +17,7 @@ class _PackageDetailScreenState extends State<PackageDetailScreen> {
|
|||||||
bool isInit = true;
|
bool isInit = true;
|
||||||
bool isEmpty = false;
|
bool isEmpty = false;
|
||||||
PackageDetailObject? datas;
|
PackageDetailObject? datas;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeDependencies() async {
|
void didChangeDependencies() async {
|
||||||
if (isInit) {
|
if (isInit) {
|
||||||
@@ -27,11 +28,12 @@ class _PackageDetailScreenState extends State<PackageDetailScreen> {
|
|||||||
(result) {
|
(result) {
|
||||||
setState(
|
setState(
|
||||||
() {
|
() {
|
||||||
if (result.id == 'null') {
|
|
||||||
isEmpty = true;
|
|
||||||
}
|
|
||||||
datas = result;
|
datas = result;
|
||||||
isInit = false;
|
isInit = false;
|
||||||
|
if (result.id == 'null')
|
||||||
|
isEmpty = true;
|
||||||
|
else
|
||||||
|
isEmpty = false;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -49,7 +51,12 @@ class _PackageDetailScreenState extends State<PackageDetailScreen> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
titleSpacing: -10,
|
titleSpacing: -10,
|
||||||
title: Text('Packages', style: TextStyle(color: Colors.white,),),
|
title: Text(
|
||||||
|
'Packages',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
|
|||||||
@@ -316,11 +316,13 @@ class PackageProvider extends ChangeNotifier {
|
|||||||
}
|
}
|
||||||
var data = json.decode(response.body)['data'];
|
var data = json.decode(response.body)['data'];
|
||||||
List<String> itemsList = [];
|
List<String> itemsList = [];
|
||||||
for (var item in data['items']) {
|
if(data['items'] != null){
|
||||||
// itemsList
|
for (var item in data['items']) {
|
||||||
// .add("${item['name']} - ${item['udi'] != null ? item['udi'] : ''}");
|
// itemsList
|
||||||
|
// .add("${item['name']} - ${item['udi'] != null ? item['udi'] : ''}");
|
||||||
itemsList
|
itemsList
|
||||||
.add("${item['id']} ${item['name']}");
|
.add("${item['id']} ${item['name']}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print(data);
|
print(data);
|
||||||
result = PackageDetailObject(
|
result = PackageDetailObject(
|
||||||
|
|||||||
Reference in New Issue
Block a user