Compare commits
3
Commits
e6951b4c25
...
2c3e52ba53
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c3e52ba53 | ||
|
|
62af007799 | ||
|
|
8f3afc3bd7 |
@@ -168,7 +168,10 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
icon: Icon(Icons.location_on),
|
||||
),
|
||||
for (final (index, alarmRequest) in alarmRequests.indexed)
|
||||
AlarmForm(
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: AlarmForm(
|
||||
request: alarmRequest,
|
||||
onChanged: (updated) {
|
||||
setState(() {
|
||||
@@ -176,6 +179,16 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => setState(() {
|
||||
alarmRequests.removeAt(index);
|
||||
}),
|
||||
icon: Icon(Icons.close),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 120),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -191,6 +204,7 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
}
|
||||
|
||||
void onSavePressed() {
|
||||
if (formKey.currentState!.validate()) {
|
||||
Navigator.of(context).pop(
|
||||
CreateTaskRequest(
|
||||
title: titleController.text,
|
||||
@@ -218,6 +232,7 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void onPopInvoked(bool didPop, Object? result) {
|
||||
if (!didPop) {
|
||||
|
||||
@@ -69,7 +69,9 @@ class _FixedTimeAlarmFormState extends State<FixedTimeAlarmForm> {
|
||||
icon: Icon(Icons.calendar_month),
|
||||
),
|
||||
),
|
||||
validator: dateTimeValidator,
|
||||
validator: (value) {
|
||||
return notEmptyValidator(value) ?? dateTimeValidator(value);
|
||||
},
|
||||
keyboardType: TextInputType.datetime,
|
||||
textInputAction: TextInputAction.next,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user