Kaynağa Gözat

获取所有线路添加请求动画

daxu0403 7 yıl önce
ebeveyn
işleme
fb25462e89
1 değiştirilmiş dosya ile 13 ekleme ve 2 silme
  1. 13 2
      lib/pages/order_taking_page.dart

+ 13 - 2
lib/pages/order_taking_page.dart

@@ -72,6 +72,9 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
 
 
   Future getLine() async {
+    setState(() {
+      lineList.clear();
+    });
     await getAllLine().then((resp) {
       if (isNotError(context, resp)) {
         setState(() {
@@ -91,7 +94,6 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
                   lineIdStr += lineList[i].id.toString();
                 }
               }
-              print(checkStatusList);
             } else {
               for (int i = 0; i < lineList.length; i++) {
                 checkStatusList.add(true);
@@ -186,7 +188,16 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
                     color: Color.fromRGBO(0, 0, 0, 0.7),
                     borderRadius: BorderRadius.all(Radius.circular(4.0))
                   ),
-                  child: ListView.builder(
+                  child:lineList.length==0?Center(
+                    child:  Container(
+                      width: ScreenUtil.getInstance().setWidth(50),
+                      height: ScreenUtil.getInstance().setHeight(50),
+                      child: CircularProgressIndicator(
+                        
+                      )
+                    ),
+                  ):
+                   ListView.builder(
                     itemCount: lineList.length,
                     itemBuilder: (BuildContext context, int index) { //itemBuilder实际上就是一个map的循环
                       if (index < lineList.length) {