factor:布局颜色重构
This commit is contained in:
@@ -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);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user