Initial (redacted) commit.
This commit is contained in:
commit
655f8a036a
368 changed files with 20949 additions and 0 deletions
53
app/lib/sembast/tasks_list.dart
Normal file
53
app/lib/sembast/tasks_list.dart
Normal file
|
@ -0,0 +1,53 @@
|
|||
// ignore_for_file: flutter_style_todos
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'tasks_list.freezed.dart';
|
||||
part 'tasks_list.g.dart';
|
||||
|
||||
@freezed
|
||||
class IndividualTodo with _$IndividualTodo {
|
||||
const factory IndividualTodo({
|
||||
required String todo,
|
||||
required bool isCompleted,
|
||||
required DateTime dueDate,
|
||||
}) = _IndividualTodo;
|
||||
factory IndividualTodo.fromJson(Map<String, Object?> json) =>
|
||||
_$IndividualTodoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class TasksItem with _$TasksItem {
|
||||
const factory TasksItem({
|
||||
required String widgetType,
|
||||
required String name,
|
||||
required bool isExpanded,
|
||||
required List<String> taskList,
|
||||
required List<String> completedTaskList,
|
||||
required bool isVisible,
|
||||
@Default(-1) int id,
|
||||
}) = _TasksItem;
|
||||
|
||||
factory TasksItem.fromJson(Map<String, Object?> json) =>
|
||||
_$TasksItemFromJson(json);
|
||||
}
|
||||
|
||||
extension JsonWithoutId on TasksItem {
|
||||
Map<String, dynamic> toJsonWithoutId() {
|
||||
final map = toJson()..remove('id');
|
||||
// map['taskList'] = taskList.map((todo) => todo.toJson()).toList();
|
||||
//map['completedTaskList'] =
|
||||
// completedTaskList.map((todo) => todo.toJson()).toList();
|
||||
return map;
|
||||
}
|
||||
}
|
||||
/*
|
||||
extension JsonWithoutID on TODO {
|
||||
Map<String, dynamic> toJsonWithoutId() {
|
||||
final map = toJson()..remove('id');
|
||||
map['taskList'] = taskList.map((todo) => todo.toJson()).toList();
|
||||
map['completedTaskList'] =
|
||||
completedTaskList.map((todo) => todo.toJson()).toList();
|
||||
return map;
|
||||
}
|
||||
}*/
|
Loading…
Add table
Add a link
Reference in a new issue