feat:增加主题色

This commit is contained in:
2026-04-26 17:22:14 +08:00
parent 8f6e4cc23e
commit db52de7b56
11 changed files with 108 additions and 93 deletions

View File

@@ -23,7 +23,9 @@ class _ScheduleDialogState extends State<ScheduleDialog> {
@override
void initState() {
super.initState();
_titleController = TextEditingController(text: widget.schedule?.title ?? '');
_titleController = TextEditingController(
text: widget.schedule?.title ?? '',
);
_selectedStartTime = widget.schedule?.startTime;
_selectedEndTime = widget.schedule?.endTime;
_selectedScheduleDate = widget.schedule?.scheduleDate;
@@ -35,34 +37,43 @@ class _ScheduleDialogState extends State<ScheduleDialog> {
super.dispose();
}
void onConfirmClick()async {
void onConfirmClick() async {
if (_selectedStartTime == null) {
await displayInfoBar(context, builder: (context, close) {
return InfoBar(
title: const Text('请选择开始时间'),
severity: InfoBarSeverity.error,
);
});
await displayInfoBar(
context,
builder: (context, close) {
return InfoBar(
title: const Text('请选择开始时间'),
severity: InfoBarSeverity.error,
);
},
);
return;
}
if (_selectedEndTime == null) {
await displayInfoBar(context, builder: (context, close) {
return InfoBar(
title: const Text('请选择结束时间'),
severity: InfoBarSeverity.error,
);
});
await displayInfoBar(
context,
builder: (context, close) {
return InfoBar(
title: const Text('请选择结束时间'),
severity: InfoBarSeverity.error,
);
},
);
return;
}
if (!_selectedEndTime!.isAfter(_selectedStartTime!)) {
await displayInfoBar(context, builder: (context, close) {
return InfoBar(
title: const Text('结束时间必须晚于开始时间'),
severity: InfoBarSeverity.error,
);
});
await displayInfoBar(
context,
builder: (context, close) {
return InfoBar(
title: const Text('结束时间必须晚于开始时间'),
severity: InfoBarSeverity.error,
);
},
);
return;
}
@@ -82,7 +93,7 @@ class _ScheduleDialogState extends State<ScheduleDialog> {
@override
Widget build(BuildContext context) {
return ContentDialog(
title: Text(widget.schedule == null ? '添加日程' : '编辑日程'),
title: Center(child: Text(widget.schedule == null ? '添加日程' : '编辑日程')),
content: _buildForm(),
actions: [
Button(