|
@@ -1,6 +1,8 @@
|
|
|
+import 'package:calendar_view/calendar_controller/controller.dart';
|
|
|
import 'package:calendar_view/utils/calendar_util.dart';
|
|
|
import 'package:calendar_view/utils/chinese_calendar_utils.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
|
|
|
class MoreSchedulePopup extends StatefulWidget {
|
|
|
const MoreSchedulePopup({
|
|
@@ -17,6 +19,15 @@ class MoreSchedulePopup extends StatefulWidget {
|
|
|
|
|
|
class MoreSchedulePopupState extends State<MoreSchedulePopup> {
|
|
|
static const double _itemHeight = 28;
|
|
|
+ List<Schedule> _scheduleDataList = [];
|
|
|
+ CalendarController calendarController = Get.find<CalendarController>();
|
|
|
+
|
|
|
+ @override
|
|
|
+ void initState() {
|
|
|
+ super.initState();
|
|
|
+ _scheduleDataList =
|
|
|
+ calendarController.scheduleListFilter(widget.scheduleData.scheduleList);
|
|
|
+ }
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
@@ -62,7 +73,7 @@ class MoreSchedulePopupState extends State<MoreSchedulePopup> {
|
|
|
addAutomaticKeepAlives: false,
|
|
|
addRepaintBoundaries: true,
|
|
|
itemExtent: _itemHeight,
|
|
|
- itemCount: widget.scheduleData.scheduleList.length,
|
|
|
+ itemCount: _scheduleDataList.length,
|
|
|
itemBuilder: (context, index) {
|
|
|
return _buildScheduleTypeItem(index);
|
|
|
},
|
|
@@ -70,9 +81,8 @@ class MoreSchedulePopupState extends State<MoreSchedulePopup> {
|
|
|
}
|
|
|
|
|
|
Widget _buildScheduleTypeItem(int scheduleIndex) {
|
|
|
- ScheduleType scheduleType =
|
|
|
- widget.scheduleData.scheduleList[scheduleIndex].type;
|
|
|
- Schedule schedule = widget.scheduleData.scheduleList[scheduleIndex];
|
|
|
+ ScheduleType scheduleType = _scheduleDataList[scheduleIndex].type;
|
|
|
+ Schedule schedule = _scheduleDataList[scheduleIndex];
|
|
|
return Material(
|
|
|
color: Colors.transparent,
|
|
|
child: InkWell(
|