feat:增加hive模块
This commit is contained in:
@@ -8,7 +8,7 @@ import 'package:flisp_app/utils/date_utils.dart';
|
||||
class TodoForm extends StatefulWidget {
|
||||
final GlobalKey<FormBuilderState> formKey;
|
||||
final bool isEditing;
|
||||
final TodoItem? initialTodo;
|
||||
final Todo? initialTodo;
|
||||
|
||||
const TodoForm({
|
||||
super.key,
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:toggle_switch/toggle_switch.dart';
|
||||
|
||||
// 统计卡片
|
||||
Widget buildStatsCard(List<TodoItem> todos) {
|
||||
Widget buildStatsCard(List<Todo> todos) {
|
||||
int totalCount = todos.length;
|
||||
|
||||
int activeCount = todos.where((todo) => !todo.isCompleted).length;
|
||||
@@ -70,9 +70,9 @@ Widget buildTabs({
|
||||
}
|
||||
|
||||
Widget buildTodoList({
|
||||
required List<TodoItem> todos,
|
||||
required List<Todo> todos,
|
||||
required ValueChanged<String> onToggleTodo,
|
||||
required ValueChanged<TodoItem> onEditTodo,
|
||||
required ValueChanged<Todo> onEditTodo,
|
||||
}) {
|
||||
return ListView.separated(
|
||||
itemCount: todos.length,
|
||||
@@ -89,9 +89,9 @@ Widget buildTodoList({
|
||||
}
|
||||
|
||||
Widget _buildTodoItem({
|
||||
required TodoItem todo,
|
||||
required Todo todo,
|
||||
required ValueChanged<String> onToggle,
|
||||
required ValueChanged<TodoItem> onEdit,
|
||||
required ValueChanged<Todo> onEdit,
|
||||
}) {
|
||||
return buildCard(
|
||||
child: ListTile(
|
||||
@@ -113,7 +113,7 @@ Widget _buildTodoItem({
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTodoTitle(TodoItem todo) {
|
||||
Widget _buildTodoTitle(Todo todo) {
|
||||
return Text(
|
||||
todo.title,
|
||||
style: TextStyle(
|
||||
@@ -125,7 +125,7 @@ Widget _buildTodoTitle(TodoItem todo) {
|
||||
}
|
||||
|
||||
// 构建待办事项副标题
|
||||
Widget? _buildTodoSubtitle(TodoItem todo) {
|
||||
Widget? _buildTodoSubtitle(Todo todo) {
|
||||
final isOverdue =
|
||||
todo.dueDate != null &&
|
||||
todo.dueDate!.isBefore(DateTime.now()) &&
|
||||
|
||||
Reference in New Issue
Block a user