textInputConfiguration property Null safety

TextInputConfiguration textInputConfiguration
override

The TextInputConfiguration that describes this AutofillClient.

In order to participate in autofill, its TextInputConfiguration.autofillConfiguration must not be null.

Implementation

@override
TextInputConfiguration get textInputConfiguration {
  final List<String>? autofillHints = widget.autofillHints?.toList(growable: false);
  final AutofillConfiguration autofillConfiguration = autofillHints != null
    ? AutofillConfiguration(
        uniqueIdentifier: autofillId,
        autofillHints: autofillHints,
        currentEditingValue: currentTextEditingValue,
      )
    : AutofillConfiguration.disabled;

  return TextInputConfiguration(
    inputType: widget.keyboardType,
    readOnly: widget.readOnly,
    obscureText: widget.obscureText,
    autocorrect: widget.autocorrect,
    smartDashesType: widget.smartDashesType,
    smartQuotesType: widget.smartQuotesType,
    enableSuggestions: widget.enableSuggestions,
    enableInteractiveSelection: widget._userSelectionEnabled,
    inputAction: widget.textInputAction ?? (widget.keyboardType == TextInputType.multiline
      ? TextInputAction.newline
      : TextInputAction.done
    ),
    textCapitalization: widget.textCapitalization,
    keyboardAppearance: widget.keyboardAppearance,
    autofillConfiguration: autofillConfiguration,
    enableIMEPersonalizedLearning: widget.enableIMEPersonalizedLearning,
  );
}