factor:布局颜色重构

This commit is contained in:
2025-11-20 11:04:29 +08:00
parent a582ebb3e4
commit 6e97d7f33f
16 changed files with 311 additions and 284 deletions

View File

@@ -128,50 +128,51 @@ class CalendarPageState extends State<CalendarPage> {
}
}
Widget _buildCalendarTabs() {
return buildTabs(
context: context,
currentTab: _currentTab,
onTabChanged: (value) {
setState(() {
_currentTab = value;
_calendarController.view = value.view;
});
},
);
}
@override
Widget build(BuildContext context) {
final provider = Provider.of<CalendarProvider>(context, listen: false);
return Padding(
padding: EdgeInsets.all(10),
child: Column(
children: [
buildTabs(
return Column(
children: [
_buildCalendarTabs(),
Expanded(
child: buildCalendar(
context: context,
currentTab: _currentTab,
onTabChanged: (value) {
setState(() {
_currentTab = value;
_calendarController.view = value.view;
});
controller: _calendarController,
dataSource: AppointmentDataSource(_appointments),
onAdd: () {
if (_calendarController.view == CalendarView.week) {
_showDialog(false, provider.formItem);
}
},
onEdit: (appointment) {
final calendar = calendarService.getCalendarById(
appointment.id as int,
);
_showDialog(true, calendar);
},
onDelete: (appointment) {
final calendar = calendarService.getCalendarById(
appointment.id as int,
);
_deleteCalendar(calendar);
},
),
Expanded(
child: buildCalendar(
context: context,
controller: _calendarController,
dataSource: AppointmentDataSource(_appointments),
onAdd: () {
if (_calendarController.view == CalendarView.week) {
_showDialog(false, provider.formItem);
}
},
onEdit: (appointment) {
final calendar = calendarService.getCalendarById(
appointment.id as int,
);
_showDialog(true, calendar);
},
onDelete: (appointment) {
final calendar = calendarService.getCalendarById(
appointment.id as int,
);
_deleteCalendar(calendar);
},
),
),
],
),
),
],
);
}
}