getFormField method Null safety

FormField? getFormField(
  1. String key
)

Implementation

FormField? getFormField(String key) {
  final index = fields.indexWhere((f) => f.key == key);
  if (index == -1) {
    return null;
  }
  return fields[index];
}