|
|
@@ -1,9 +1,9 @@
|
|
|
+import 'package:application/view/home/data_detail/data_detail_cp.dart';
|
|
|
import 'package:application/widget.dart';
|
|
|
import 'package:common_pub/ui/map_view/map_view.dart';
|
|
|
import 'package:common_pub/ui/map_view/view_map_image.dart';
|
|
|
import 'package:common_pub/ui/map_view/view_map_touch.dart';
|
|
|
import 'package:common_pub/ui/map_view/view_plug_loading.dart';
|
|
|
-import 'package:get_storage/get_storage.dart';
|
|
|
import 'data_detail_controller.dart';
|
|
|
|
|
|
class DataDetailPage extends StatelessWidget {
|
|
|
@@ -71,12 +71,17 @@ class _UserListView extends GetView<DataDetailController> {
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
children: [
|
|
|
const Text('用户列表'),
|
|
|
- IconButton(onPressed: () {}, icon: const Icon(Icons.more_horiz)),
|
|
|
+ IconButton(
|
|
|
+ onPressed: controller.selectedDetail.value != null
|
|
|
+ ? () => controller.showDetail.value =
|
|
|
+ !controller.showDetail.value
|
|
|
+ : null,
|
|
|
+ icon: const Icon(Icons.more_horiz)),
|
|
|
],
|
|
|
),
|
|
|
Expanded(
|
|
|
child: ListView(
|
|
|
- children: controller.userList
|
|
|
+ children: controller.showDetail.value? _detailView(): controller.userList
|
|
|
.map((element) => _userElem(element))
|
|
|
.toList(),
|
|
|
))
|
|
|
@@ -85,6 +90,13 @@ class _UserListView extends GetView<DataDetailController> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ List<Widget> _detailView() {
|
|
|
+ return [
|
|
|
+ // DataDetailCP(cpList: controller.)
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
Widget _userElem(UserInfo data) {
|
|
|
return Obx(() {
|
|
|
final children = <Widget>[
|
|
|
@@ -98,34 +110,39 @@ class _UserListView extends GetView<DataDetailController> {
|
|
|
boxShadow: const [
|
|
|
BoxShadow(color: Color(0x29000000), blurRadius: 3)
|
|
|
],
|
|
|
- borderRadius: BorderRadius.circular(3.56)
|
|
|
- ),
|
|
|
+ borderRadius: BorderRadius.circular(3.56)),
|
|
|
child: Row(
|
|
|
children: [
|
|
|
Container(
|
|
|
height: double.infinity,
|
|
|
width: 3.56,
|
|
|
margin: const EdgeInsets.only(top: 8, bottom: 8, right: 3.55),
|
|
|
- decoration: BoxDecoration(color: data.data.oId == controller.selectedUserId.value
|
|
|
- ? Colors.orange: Colors.transparent, borderRadius: BorderRadius.circular(2.1)),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: data.data.oId == controller.selectedUserId.value
|
|
|
+ ? Colors.orange
|
|
|
+ : Colors.transparent,
|
|
|
+ borderRadius: BorderRadius.circular(2.1)),
|
|
|
),
|
|
|
Text(data.data.oName),
|
|
|
const Spacer(),
|
|
|
- IconButton(onPressed: (){
|
|
|
- data.isExpand.value = !data.isExpand.value;
|
|
|
- }, icon: Icon(data.isExpand.value? Icons.arrow_drop_up: Icons.arrow_drop_down))
|
|
|
+ IconButton(
|
|
|
+ onPressed: () {
|
|
|
+ data.isExpand.value = !data.isExpand.value;
|
|
|
+ },
|
|
|
+ icon: Icon(data.isExpand.value
|
|
|
+ ? Icons.arrow_drop_up
|
|
|
+ : Icons.arrow_drop_down))
|
|
|
],
|
|
|
),
|
|
|
)
|
|
|
];
|
|
|
- if(data.isExpand.value){
|
|
|
+ if (data.isExpand.value) {
|
|
|
children.add(Column(
|
|
|
- children: data.data.list.map((element) => GestureDetector(
|
|
|
- onTap: (){
|
|
|
- controller.selectedDetail.value = element;
|
|
|
- controller.selectedUserId.value = data.data.oId;
|
|
|
- },
|
|
|
- child: detailElem(element))).toList(),
|
|
|
+ children: data.data.list
|
|
|
+ .map((element) => GestureDetector(
|
|
|
+ onTap: () => controller.selectDetail(element, data),
|
|
|
+ child: detailElem(element)))
|
|
|
+ .toList(),
|
|
|
));
|
|
|
}
|
|
|
|
|
|
@@ -135,40 +152,48 @@ class _UserListView extends GetView<DataDetailController> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- Widget detailElem(DetailSimple detail){
|
|
|
+ Widget detailElem(DetailSimple detail) {
|
|
|
return Container(
|
|
|
- margin: const EdgeInsets.only(left: 12, top: 2 , bottom: 4),
|
|
|
- width: double.infinity,
|
|
|
- height: 54,
|
|
|
- padding: const EdgeInsets.fromLTRB(4, 6, 4, 6),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
- borderRadius: BorderRadius.circular(3.5),
|
|
|
- boxShadow: const [
|
|
|
- BoxShadow(color: Color(0x33000000), blurRadius: 1.3)
|
|
|
- ]
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- height: double.infinity,
|
|
|
- width: 3.56,
|
|
|
- margin: const EdgeInsets.only(right: 3.55),
|
|
|
- decoration: BoxDecoration(color: detail.gameId == controller.selectedDetail.value.gameId
|
|
|
- ? Colors.orange: Colors.transparent, borderRadius: BorderRadius.circular(2.1)),
|
|
|
- ),
|
|
|
- Expanded(child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Text(detail.courseName, maxLines: 1, overflow: TextOverflow.ellipsis),
|
|
|
- Text(detail.actName, maxLines: 1, overflow: TextOverflow.ellipsis,),
|
|
|
- ],
|
|
|
- )),
|
|
|
- const SizedBox(width: 12),
|
|
|
- Text(detail.isComplete?'完赛':'未完赛')
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
+ margin: const EdgeInsets.only(left: 12, top: 2, bottom: 4),
|
|
|
+ width: double.infinity,
|
|
|
+ height: 54,
|
|
|
+ padding: const EdgeInsets.fromLTRB(4, 6, 4, 6),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: BorderRadius.circular(3.5),
|
|
|
+ boxShadow: const [
|
|
|
+ BoxShadow(color: Color(0x33000000), blurRadius: 1.3)
|
|
|
+ ]),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ height: double.infinity,
|
|
|
+ width: 3.56,
|
|
|
+ margin: const EdgeInsets.only(right: 3.55),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: detail.gameId ==
|
|
|
+ controller.selectedDetailSimple.value.gameId
|
|
|
+ ? Colors.orange
|
|
|
+ : Colors.transparent,
|
|
|
+ borderRadius: BorderRadius.circular(2.1)),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Text(detail.courseName,
|
|
|
+ maxLines: 1, overflow: TextOverflow.ellipsis),
|
|
|
+ Text(
|
|
|
+ detail.actName,
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )),
|
|
|
+ const SizedBox(width: 12),
|
|
|
+ Text(detail.isComplete ? '完赛' : '未完赛')
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
}
|
|
|
-
|
|
|
}
|