Widget.materialSwitch constructor Null safety

const Widget.materialSwitch(
  1. {Key? key,
  2. required bool value,
  3. FormBoolField? field,
  4. Color? activeColor,
  5. Color? activeTrackColor,
  6. Color? inactiveThumbColor,
  7. Color? inactiveTrackColor,
  8. ImageProvider? activeThumbImage,
  9. ImageProvider? inactiveThumbImage,
  10. MaterialStateProperty? thumbColor,
  11. MaterialStateProperty? trackColor,
  12. MaterialTapTargetSize? materialTapTargetSize,
  13. @Default(DragStartBehavior.start) DragStartBehavior dragStartBehavior,
  14. MouseCursor? mouseCursor,
  15. Color? focusColor,
  16. Color? hoverColor,
  17. MaterialStateProperty? overlayColor,
  18. double? splashRadius,
  19. BoolSelectionCallback? onFocusChange,
  20. @Default(false) bool autofocus}
)

Implementation

const factory Widget.materialSwitch({
  Key? key,
  required bool value,
  FormBoolField? field,
  Color? activeColor,
  Color? activeTrackColor,
  Color? inactiveThumbColor,
  Color? inactiveTrackColor,
  ImageProvider? activeThumbImage,
  ImageProvider? inactiveThumbImage,
  MaterialStateProperty? thumbColor,
  MaterialStateProperty? trackColor,
  MaterialTapTargetSize? materialTapTargetSize,
  @Default(DragStartBehavior.start) DragStartBehavior dragStartBehavior,
  MouseCursor? mouseCursor,
  Color? focusColor,
  Color? hoverColor,
  MaterialStateProperty? overlayColor,
  double? splashRadius,
  BoolSelectionCallback? onFocusChange,
  @Default(false) bool autofocus,
}) = Switch;