PlatformTextField constructor Null safety

PlatformTextField(
  1. {Key? key,
  2. Key? widgetKey,
  3. TextEditingController? controller,
  4. FocusNode? focusNode,
  5. TextInputType? keyboardType,
  6. TextInputAction? textInputAction,
  7. TextCapitalization? textCapitalization = TextCapitalization.none,
  8. TextStyle? style,
  9. TextAlign? textAlign,
  10. bool? autofocus,
  11. bool? obscureText,
  12. bool? autocorrect,
  13. int? maxLines = 1,
  14. int? maxLength,
  15. bool? maxLengthEnforced,
  16. void onChanged(
    1. String
    )?,
  17. void onEditingComplete(
      )?,
    1. void onSubmitted(
      1. String
      )?,
    2. List<TextInputFormatter>? inputFormatters,
    3. bool? enabled,
    4. double? cursorWidth,
    5. Radius? cursorRadius,
    6. Color? cursorColor,
    7. Brightness? keyboardAppearance,
    8. EdgeInsets? scrollPadding,
    9. DragStartBehavior? dragStartBehavior,
    10. int? minLines,
    11. bool? expands,
    12. ScrollPhysics? scrollPhysics,
    13. StrutStyle? strutStyle,
    14. bool? enableInteractiveSelection,
    15. ScrollController? scrollController,
    16. GestureTapCallback? onTap,
    17. bool? readOnly,
    18. bool? showCursor,
    19. TextAlignVertical? textAlignVertical,
    20. ToolbarOptions? toolbarOptions,
    21. SmartDashesType? smartDashesType,
    22. SmartQuotesType? smartQuotesType,
    23. BoxHeightStyle? selectionHeightStyle,
    24. BoxWidthStyle? selectionWidthStyle,
    25. String? obscuringCharacter,
    26. Iterable<String>? autofillHints,
    27. double? cursorHeight,
    28. String? restorationId,
    29. MaxLengthEnforcement? maxLengthEnforcement,
    30. TextSelectionControls? selectionControls,
    31. String? hintText,
    32. PlatformBuilder<MaterialTextFieldData>? material,
    33. PlatformBuilder<CupertinoTextFieldData>? cupertino}
    )

    Implementation

    PlatformTextField({
      Key? key,
      this.widgetKey,
      this.controller,
      this.focusNode,
      TextInputType? keyboardType,
      this.textInputAction,
      this.textCapitalization = TextCapitalization.none,
      this.style,
      this.textAlign,
      this.autofocus,
      this.obscureText,
      this.autocorrect,
      this.maxLines = 1,
      this.maxLength,
      this.maxLengthEnforced,
      this.onChanged,
      this.onEditingComplete,
      this.onSubmitted,
      this.inputFormatters,
      this.enabled,
      this.cursorWidth,
      this.cursorRadius,
      this.cursorColor,
      this.keyboardAppearance,
      this.scrollPadding,
      this.dragStartBehavior,
      this.minLines,
      this.expands,
      this.scrollPhysics,
      this.strutStyle,
      this.enableInteractiveSelection,
      this.scrollController,
      this.onTap,
      this.readOnly,
      this.showCursor,
      this.textAlignVertical,
      this.toolbarOptions,
      this.smartDashesType,
      this.smartQuotesType,
      this.selectionHeightStyle,
      this.selectionWidthStyle,
      this.obscuringCharacter,
      this.autofillHints,
      this.cursorHeight,
      this.restorationId,
      this.maxLengthEnforcement,
      this.selectionControls,
      this.hintText,
      this.material,
      this.cupertino,
    })  : keyboardType = keyboardType ??
              (maxLines == 1 ? TextInputType.text : TextInputType.multiline),
          super(key: key);