소스 검색

[fit]1.数据为空,不进行初始化

云天逵 7 달 전
부모
커밋
6bc30cb306
1개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제
  1. 8 5
      lib/module/character/character_controller.dart

+ 8 - 5
lib/module/character/character_controller.dart

@@ -71,11 +71,14 @@ class CharacterController extends BaseController
   void _dataLoad() async {
   void _dataLoad() async {
     AtmobLog.d(tag, "_dataLoad");
     AtmobLog.d(tag, "_dataLoad");
 
 
-    tabController.value = TabController(
-      length: characterGroupList.length,
-      vsync: this,
-      initialIndex: 0,
-    );
+    if( characterGroupList.isNotEmpty){
+      tabController.value = TabController(
+        length: characterGroupList.length,
+        vsync: this,
+        initialIndex: 0,
+      );
+    }
+
 
 
     ever(keyboardInfoList, (value) {
     ever(keyboardInfoList, (value) {
       AtmobLog.d(tag, "keyboardInfoList1 changed ${keyboardInfoList.length}");
       AtmobLog.d(tag, "keyboardInfoList1 changed ${keyboardInfoList.length}");