createMaterialWidget method

  1. @override
TextField createMaterialWidget(
  1. BuildContext context
)
override

Implementation

@override
TextField createMaterialWidget(BuildContext context) {
  final data = material?.call(context, platform(context));

  final hintText = this.hintText;
  final decoration = hintText == null
      ? (data?.decoration ?? const InputDecoration())
      : _inputDecorationWithHint(
          hintText,
          data?.decoration ?? const InputDecoration(),
        );

  return TextField(
    key: data?.widgetKey ?? widgetKey,
    autocorrect: data?.autocorrect ?? autocorrect ?? true,
    autofocus: data?.autofocus ?? autofocus ?? false,
    controller: data?.controller ?? controller,
    cursorColor: data?.cursorColor ?? cursorColor,
    cursorRadius: data?.cursorRadius ?? cursorRadius,
    cursorWidth: data?.cursorWidth ?? cursorWidth ?? 2.0,
    enabled: data?.enabled ?? enabled,
    focusNode: data?.focusNode ?? focusNode,
    inputFormatters: data?.inputFormatters ?? inputFormatters,
    keyboardAppearance: data?.keyboardAppearance ?? keyboardAppearance,
    keyboardType: data?.keyboardType ?? keyboardType,
    maxLength: data?.maxLength ?? maxLength,
    maxLines: data?.maxLines ?? maxLines,
    obscureText: data?.obscureText ?? obscureText ?? false,
    onChanged: data?.onChanged ?? onChanged,
    onEditingComplete: data?.onEditingComplete ?? onEditingComplete,
    onSubmitted: data?.onSubmitted ?? onSubmitted,
    scrollPadding:
        data?.scrollPadding ?? scrollPadding ?? const EdgeInsets.all(20),
    style: data?.style ?? style,
    textAlign: data?.textAlign ?? textAlign ?? TextAlign.start,
    textCapitalization: data?.textCapitalization ??
        textCapitalization ??
        TextCapitalization.none,
    textInputAction: data?.textInputAction ?? textInputAction,
    decoration: decoration,
    textDirection: data?.textDirection,
    buildCounter: data?.buildCounter,
    dragStartBehavior: data?.dragStartBehavior ??
        dragStartBehavior ??
        DragStartBehavior.start,
    expands: data?.expands ?? expands ?? false,
    minLines: data?.minLines ?? minLines,
    scrollPhysics: data?.scrollPhysics ?? scrollPhysics,
    strutStyle: data?.strutStyle ?? strutStyle,
    enableInteractiveSelection: data?.enableInteractiveSelection ??
        enableInteractiveSelection ??
        true,
    scrollController: data?.scrollController ?? scrollController,
    onTap: data?.onTap ?? onTap,
    readOnly: data?.readOnly ?? readOnly ?? false,
    showCursor: data?.showCursor ?? showCursor,
    textAlignVertical: data?.textAlignVertical ?? textAlignVertical,
    enableSuggestions: data?.enableSuggestions ?? true,
    smartQuotesType: data?.smartQuotesType ?? smartQuotesType,
    smartDashesType: data?.smartDashesType ?? smartDashesType,
    selectionHeightStyle: data?.selectionHeightStyle ??
        selectionHeightStyle ??
        ui.BoxHeightStyle.tight,
    selectionWidthStyle: data?.selectionWidthStyle ??
        selectionWidthStyle ??
        ui.BoxWidthStyle.tight,
    obscuringCharacter: data?.obscuringCharacter ?? obscuringCharacter ?? '•',
    autofillHints: data?.autofillHints ?? autofillHints,
    mouseCursor: data?.mouseCursor ?? MouseCursor.defer,
    onAppPrivateCommand: data?.onAppPrivateCommand,
    cursorHeight: data?.cursorHeight ?? cursorHeight,
    restorationId: data?.restorationId ?? restorationId,
    maxLengthEnforcement: data?.maxLengthEnforcement ?? maxLengthEnforcement,
    selectionControls: data?.selectionControls ?? selectionControls,
    enableIMEPersonalizedLearning: data?.enableIMEPersonalizedLearning ??
        enableIMEPersonalizedLearning ??
        true,
    clipBehavior: data?.clipBehavior ?? clipBehavior,
    scribbleEnabled: data?.scribbleEnabled ?? scribbleEnabled,
    contextMenuBuilder: data?.contextMenuBuilder ??
        contextMenuBuilder ??
        _defaultMaterialContextMenuBuilder,
    onTapOutside: data?.onTapOutside ?? onTapOutside,
    spellCheckConfiguration:
        data?.spellCheckConfiguration ?? spellCheckConfiguration,
    magnifierConfiguration:
        data?.magnifierConfiguration ?? magnifierConfiguration,
    canRequestFocus: data?.canRequestFocus ?? true,
    contentInsertionConfiguration:
        data?.contentInsertionConfiguration ?? contentInsertionConfiguration,
    cursorOpacityAnimates:
        data?.cursorOpacityAnimates ?? cursorOpacityAnimates,
    undoController: data?.undoController ?? undoController,
    cursorErrorColor: data?.cursorErrorColor,
    onTapAlwaysCalled: data?.onTapAlwaysCalled ?? false,
    statesController: data?.statesController,
    // toolbarOptions: Deprecated
  );
}