feat:更新待办事项对话框功能

This commit is contained in:
2025-11-07 14:33:26 +08:00
parent d7ce7d644a
commit 0f106f6adc
19 changed files with 626 additions and 700 deletions

View File

@@ -1,11 +1,12 @@
import 'package:flutter/material.dart';
class AppProvider with ChangeNotifier {
class AppProvider with ChangeNotifier {
int _currentIndex = 0;
int get currentIndex => _currentIndex;
void changeTab(int index) {
_currentIndex = index;
notifyListeners();
}
}
}

View File

@@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
import 'package:flisp_app/models/todo.dart';
class TodoProvider with ChangeNotifier {
TodoItem _formItem = TodoItem.getEmpty();
TodoItem get formItem => _formItem;
void resetForm() {
_formItem = TodoItem.getEmpty();
notifyListeners();
}
void initForm(TodoItem todo) {
_formItem.title = todo.title;
_formItem.content = todo.content ?? '';
_formItem.dueDate = todo.dueDate;
_formItem.priority = todo.priority;
notifyListeners();
}
}