File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ class _AddEditNotePageState extends State<AddEditNotePage>
168
168
});
169
169
});
170
170
bool isFormValid () {
171
- return description.isNotEmpty;
171
+ return description.isNotEmpty || title.isNotEmpty ;
172
172
}
173
173
174
174
void startFixTitle () {
@@ -193,17 +193,13 @@ class _AddEditNotePageState extends State<AddEditNotePage>
193
193
}
194
194
195
195
void addOrUpdateNote () async {
196
- final isValid = _formKey.currentState! .validate ();
197
-
198
- if (isValid) {
199
196
final isUpdating = widget.note != null || savedOnce;
200
197
201
198
if (isUpdating) {
202
199
await updateNote ();
203
200
} else {
204
201
await addNote ();
205
202
}
206
- }
207
203
}
208
204
209
205
Future updateNote () async {
Original file line number Diff line number Diff line change @@ -83,9 +83,9 @@ class NoteFormWidget extends StatelessWidget {
83
83
hintText: 'Type something...' ,
84
84
//hintStyle: TextStyle(color: Colors.white60),
85
85
),
86
- validator: (title) => title != null && title.isEmpty
87
- ? 'The description cannot be empty'
88
- : null ,
86
+ // validator: (title) => title != null && title.isEmpty
87
+ // ? 'The description cannot be empty'
88
+ // : null,
89
89
onChanged: onChangedDescription,
90
90
);
91
91
}
You can’t perform that action at this time.
0 commit comments