feat:更新代办事项存储功能
This commit is contained in:
@@ -25,14 +25,6 @@ class _TodoFormState extends State<TodoForm> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
// 如果是编辑模式,初始化数据
|
||||
if (widget.isEditing && widget.initialTodo != null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final store = Provider.of<TodoProvider>(context, listen: false);
|
||||
store.initForm(widget.initialTodo!);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -201,7 +193,8 @@ class _TodoFormState extends State<TodoForm> {
|
||||
: null,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value != null && value.isBefore(DateTime.now())) {
|
||||
if (value != null &&
|
||||
value.isBefore(DateTime.now().subtract(Duration(days: 1)))) {
|
||||
return '不能选择过去的日期';
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user