|
@@ -1,5 +1,6 @@
|
|
|
import 'package:calendar_view/popup_layer/popup_layer_controller.dart';
|
|
|
import 'package:calendar_view/utils/calendar_util.dart';
|
|
|
+import 'package:calendar_view/utils/event_type.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
@@ -9,6 +10,7 @@ class ScheduleList extends StatefulWidget {
|
|
|
required this.maxLines,
|
|
|
required this.scheduleDataList,
|
|
|
required this.onTapShowMore,
|
|
|
+ required this.onTapShowSchedule,
|
|
|
}) : super(key: key);
|
|
|
|
|
|
/// 可容纳的最大日程行数
|
|
@@ -23,6 +25,9 @@ class ScheduleList extends StatefulWidget {
|
|
|
/// 点击显示更多
|
|
|
final VoidCallback onTapShowMore;
|
|
|
|
|
|
+ /// 点击显示日程卡片
|
|
|
+ final ValueCallback onTapShowSchedule;
|
|
|
+
|
|
|
@override
|
|
|
ScheduleListState createState() => ScheduleListState();
|
|
|
}
|
|
@@ -31,7 +36,6 @@ class ScheduleListState extends State<ScheduleList> {
|
|
|
/// 容纳的数量
|
|
|
int _itemCount = 0;
|
|
|
PopupLayerController popupLayerController = Get.find<PopupLayerController>();
|
|
|
-
|
|
|
@override
|
|
|
void initState() {
|
|
|
super.initState();
|
|
@@ -76,22 +80,26 @@ class ScheduleListState extends State<ScheduleList> {
|
|
|
widget.scheduleDataList.length - _itemCount + 1);
|
|
|
}
|
|
|
}
|
|
|
+ GlobalKey _scheduleListKey = GlobalKey();
|
|
|
+
|
|
|
ScheduleType scheduleType = widget.scheduleDataList[scheduleIndex].type;
|
|
|
Schedule schedule = widget.scheduleDataList[scheduleIndex];
|
|
|
return Material(
|
|
|
color: Colors.transparent,
|
|
|
child: InkWell(
|
|
|
+ key: _scheduleListKey,
|
|
|
customBorder: RoundedRectangleBorder(
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
),
|
|
|
onTap: () {
|
|
|
- ScaffoldMessenger.of(context).showSnackBar(
|
|
|
- SnackBar(
|
|
|
- backgroundColor: scheduleType.color,
|
|
|
- duration: const Duration(milliseconds: 500),
|
|
|
- content: Text('点击了${scheduleType.typeName}'),
|
|
|
- ),
|
|
|
- );
|
|
|
+ // ScaffoldMessenger.of(context).showSnackBar(
|
|
|
+ // SnackBar(
|
|
|
+ // backgroundColor: scheduleType.color,
|
|
|
+ // duration: const Duration(milliseconds: 500),
|
|
|
+ // content: Text('点击了${scheduleType.typeName}'),
|
|
|
+ // ),
|
|
|
+ // );
|
|
|
+ widget.onTapShowSchedule.call(_scheduleListKey);
|
|
|
},
|
|
|
hoverColor: const Color.fromARGB(255, 227, 228, 228),
|
|
|
child: Container(
|