createCupertinoWidget method Null safety

  1. @override
CupertinoTextField createCupertinoWidget(
  1. BuildContext context
)
override

Implementation

@override
CupertinoTextField createCupertinoWidget(BuildContext context) {
  final data = cupertino?.call(context, platform(context));

  return CupertinoTextField(
    key: data?.widgetKey ?? widgetKey,
    autocorrect: data?.autocorrect ?? autocorrect ?? true,
    autofocus: data?.autofocus ?? autofocus ?? false,
    controller: data?.controller ?? controller,
    cursorColor:
        data?.cursorColor ?? cursorColor ?? CupertinoColors.activeBlue,
    cursorRadius:
        data?.cursorRadius ?? cursorRadius ?? const Radius.circular(2.0),
    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,
    maxLengthEnforced: data?.maxLengthEnforced ?? maxLengthEnforced ?? true,
    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.0),
    style: data?.style ?? style,
    textAlign: data?.textAlign ?? textAlign ?? TextAlign.start,
    textCapitalization: data?.textCapitalization ??
        textCapitalization ??
        TextCapitalization.none,
    textInputAction: data?.textInputAction ?? textInputAction,
    decoration: data?.decoration ?? _kDefaultRoundedBorderDecoration,
    clearButtonMode: data?.clearButtonMode ?? OverlayVisibilityMode.never,
    padding: data?.padding ?? const EdgeInsets.all(6.0),
    placeholder: data?.placeholder ?? hintText,
    placeholderStyle: data?.placeholderStyle ??
        const TextStyle(
          fontWeight: FontWeight.w400,
          color: CupertinoColors.placeholderText,
        ),
    prefix: data?.prefix,
    prefixMode: data?.prefixMode ?? OverlayVisibilityMode.always,
    suffix: data?.suffix,
    suffixMode: data?.suffixMode ?? OverlayVisibilityMode.always,
    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,
    toolbarOptions: data?.toolbarOptions ?? toolbarOptions,
    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,
    cursorHeight: data?.cursorHeight ?? cursorHeight,
    restorationId: data?.restorationId ?? restorationId,
    maxLengthEnforcement: data?.maxLengthEnforcement ?? maxLengthEnforcement,
    selectionControls: data?.selectionControls ?? selectionControls,
  );
}