TextEditingController constructor Null safety

TextEditingController(
  1. {String? text}
)

Creates a controller for an editable text field.

This constructor treats a null text argument as if it were the empty string.

Implementation

TextEditingController({ String? text })
  : super(text == null ? TextEditingValue.empty : TextEditingValue(text: text));