Skip to content

Commit babacea

Browse files
committed
fix: static code analysis, until (dart 3.2.0 fixes)[dart-archive/linter@411a3f5]
1 parent 5101607 commit babacea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/fields/form_builder_date_time_picker.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,11 @@ class _FormBuilderDateTimePickerState extends FormBuilderFieldDecorationState<
298298
newValue = await _showDatePicker(context, currentValue);
299299
break;
300300
case InputType.time:
301-
final newTime = await _showTimePicker(context, currentValue);
302-
newValue = null != newTime ? convert(newTime) : null;
301+
if (!context.mounted) return null;
302+
newValue = convert(await _showTimePicker(context, currentValue));
303303
break;
304304
case InputType.both:
305+
if (!context.mounted) return null;
305306
final date = await _showDatePicker(context, currentValue);
306307
if (date != null) {
307308
if (!mounted) break;

0 commit comments

Comments
 (0)