DynamicFieldItem.fromField constructor

DynamicFieldItem.fromField(
  1. Field field, {
  2. Object? value,
})

Implementation

factory DynamicFieldItem.fromField(Field field, {Object? value}) {
  final TextEditingController controller = TextEditingController();
  if (value != null && isScalar(value)) {
    controller.text = value.toString();
  }
  return DynamicFieldItem(controller: controller, value: value, field: field);
}