|
@@ -10,6 +10,7 @@ import 'package:lszlgl/config/borders.dart';
|
10
|
10
|
import 'package:lszlgl/main.dart';
|
11
|
11
|
import 'package:lszlgl/model/api_rsp.dart';
|
12
|
12
|
import 'package:lszlgl/model/rsp/storehouse_rsp.dart';
|
|
13
|
+import 'package:lszlgl/network/my_api.dart';
|
13
|
14
|
import 'package:lszlgl/widget/page_widget.dart';
|
14
|
15
|
import 'package:lszlgl/widget/storehouse_item.dart';
|
15
|
16
|
|
|
@@ -41,18 +42,19 @@ class _StoreHousePageState extends BaseLifecycleState<StoreHousePage> {
|
41
|
42
|
void loadData() async{
|
42
|
43
|
pageState.update(pageState.value.loading());
|
43
|
44
|
try{
|
44
|
|
- String jsonStr = await Future.delayed(const Duration(seconds: 3),()async{
|
45
|
|
- return rootBundle.loadString('assets/json/storehouse.json');
|
46
|
|
- });
|
47
|
|
- Map<String,dynamic> val = json.decode(jsonStr);
|
48
|
|
- ApiRsp<List<storehouseRsp?>> res= ApiRsp<List<storehouseRsp>>.fromJson(
|
49
|
|
- val,
|
50
|
|
- (json) => json is List<dynamic>
|
51
|
|
- ? json
|
52
|
|
- .map<storehouseRsp>((i) => storehouseRsp.fromJson(i as Map<String, dynamic>))
|
53
|
|
- .toList()
|
54
|
|
- : List.empty(),
|
55
|
|
- );
|
|
45
|
+ // String jsonStr = await Future.delayed(const Duration(seconds: 3),()async{
|
|
46
|
+ // return rootBundle.loadString('assets/json/storehouse.json');
|
|
47
|
+ // });
|
|
48
|
+ // Map<String,dynamic> val = json.decode(jsonStr);
|
|
49
|
+ // ApiRsp<List<storehouseRsp?>> res= ApiRsp<List<storehouseRsp>>.fromJson(
|
|
50
|
+ // val,
|
|
51
|
+ // (json) => json is List<dynamic>
|
|
52
|
+ // ? json
|
|
53
|
+ // .map<storehouseRsp>((i) => storehouseRsp.fromJson(i as Map<String, dynamic>))
|
|
54
|
+ // .toList()
|
|
55
|
+ // : List.empty(),
|
|
56
|
+ // );
|
|
57
|
+ var res = await MyApi.get(baseUrl: 'http://101.36.160.117:28088').getStoreMessage(widget.houseNum, 'zhijian');
|
56
|
58
|
if(res.data == null ){
|
57
|
59
|
pageState.update(pageState.value.empty());
|
58
|
60
|
}else{
|