|
|
@@ -1,9 +1,11 @@
|
|
|
import 'package:application/utils.dart';
|
|
|
+import 'package:application/view/home/data_detail/data_detail_controller.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
import 'package:common_pub/model/control_point.dart';
|
|
|
import 'package:common_pub/ui/control_point_history_view.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
-class DataDetailCP extends StatelessWidget {
|
|
|
+class DataDetailCP extends GetView<DataDetailController> {
|
|
|
final List<ControlPoint> cpList;
|
|
|
|
|
|
const DataDetailCP({super.key, required this.cpList});
|
|
|
@@ -15,7 +17,33 @@ class DataDetailCP extends StatelessWidget {
|
|
|
decoration: BoxDecoration(
|
|
|
color: const Color(0xffe0e0e0),
|
|
|
borderRadius: BorderRadius.circular(3.56)),
|
|
|
- child: ControlPointHistoryView(cpList: cpList));
|
|
|
+ child: Column(children: [
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.isCPExpand.value = !controller.isCPExpand.value;
|
|
|
+ },
|
|
|
+ child: Obx(() => Container(
|
|
|
+ padding: const EdgeInsets.fromLTRB(12, 4, 12, 4),
|
|
|
+ margin: EdgeInsets.only(
|
|
|
+ bottom: controller.isCPExpand.value ? 4 : 0),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: BorderRadius.circular(3.56)),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ const Text('控制点'),
|
|
|
+ const Spacer(),
|
|
|
+ Icon(controller.isCPExpand.value
|
|
|
+ ? Icons.arrow_drop_up
|
|
|
+ : Icons.arrow_drop_down)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )),
|
|
|
+ ),
|
|
|
+ Obx(() => controller.isCPExpand.value
|
|
|
+ ? ControlPointHistoryView(cpList: cpList)
|
|
|
+ : const SizedBox())
|
|
|
+ ]));
|
|
|
}
|
|
|
}
|
|
|
|