Notifications
This commit is contained in:
@@ -117,6 +117,10 @@ class _ModalEditTodoState extends State<ModalEditTodo> {
|
||||
const SizedBox(height: 20),
|
||||
SegmentedButton(
|
||||
segments: const [
|
||||
ButtonSegment(
|
||||
value: "Delete",
|
||||
label: Text("Delete"),
|
||||
icon: Icon(Icons.delete)),
|
||||
ButtonSegment(
|
||||
value: "Cancel",
|
||||
label: Text("Cancel"),
|
||||
@@ -131,6 +135,8 @@ class _ModalEditTodoState extends State<ModalEditTodo> {
|
||||
onSelectionChanged: (p0) {
|
||||
if (p0.last == "Save") {
|
||||
context.read<TodoProvider>().updateTodo(widget.oldValue, tempValue, combineTime());
|
||||
} else if (p0.last == "Delete") {
|
||||
context.read<TodoProvider>().removeTodo(widget.oldValue);
|
||||
}
|
||||
Navigator.pop(context);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user