|
|
@ -3,7 +3,6 @@ import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/rendering.dart'; |
|
|
|
import 'package:flutter/rendering.dart'; |
|
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
|
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
|
|
|
|
import 'package:huixiang/main.dart'; |
|
|
|
import 'package:huixiang/main.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/banner.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/banner.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
@ -44,8 +43,8 @@ class _CommunityCourse extends State<CommunityCourse> |
|
|
|
List<CourseList> classList = []; |
|
|
|
List<CourseList> classList = []; |
|
|
|
List<CourseList> classTabList = []; |
|
|
|
List<CourseList> classTabList = []; |
|
|
|
List<CollectClassList> collectList = []; |
|
|
|
List<CollectClassList> collectList = []; |
|
|
|
List<CourseList> collect = []; |
|
|
|
|
|
|
|
int checkIndex = 0; |
|
|
|
int checkIndex = 0; |
|
|
|
|
|
|
|
Map<String,List<CourseList>> collectMap = new Map(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
@ -166,8 +165,9 @@ class _CommunityCourse extends State<CommunityCourse> |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
collectList.clear(); |
|
|
|
collectList.clear(); |
|
|
|
collectList.addAll(baseData.data); |
|
|
|
collectList.addAll(baseData.data); |
|
|
|
if(collectList.length > 0) |
|
|
|
collectList.forEach((element) { |
|
|
|
collectCourse(collectList[0].id); |
|
|
|
collectCourse(element.id); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
EasyLoading.dismiss(); |
|
|
|
EasyLoading.dismiss(); |
|
|
@ -187,8 +187,11 @@ class _CommunityCourse extends State<CommunityCourse> |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
collect.clear(); |
|
|
|
if(!collectMap.containsKey(collectId)){ |
|
|
|
collect.addAll(baseData.data); |
|
|
|
collectMap[collectId] = []; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
collectMap[collectId].clear(); |
|
|
|
|
|
|
|
collectMap[collectId].addAll(baseData.data); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -259,7 +262,7 @@ class _CommunityCourse extends State<CommunityCourse> |
|
|
|
SizedBox(height: 28), |
|
|
|
SizedBox(height: 28), |
|
|
|
|
|
|
|
|
|
|
|
///合集列表 |
|
|
|
///合集列表 |
|
|
|
HomeClass(collect,collectList,), |
|
|
|
HomeClass(collectMap,collectList,), |
|
|
|
|
|
|
|
|
|
|
|
///课程导航栏 |
|
|
|
///课程导航栏 |
|
|
|
ClassTitleTab(classSelectList,(index){ |
|
|
|
ClassTitleTab(classSelectList,(index){ |
|
|
|