CupertinoSearchBarData constructor

CupertinoSearchBarData({
  1. Key? widgetKey,
  2. TextEditingController? controller,
  3. FocusNode? focusNode,
  4. void onTap()?,
  5. ValueChanged<String>? onChanged,
  6. bool? autofocus,
  7. TextInputType? keyboardType,
  8. ValueChanged<String>? onSubmitted,
  9. BoxDecoration? decoration,
  10. BorderRadius? borderRadius,
  11. Color itemColor = CupertinoColors.secondaryLabel,
  12. double itemSize = 20.0,
  13. EdgeInsetsGeometry prefixInsets = const EdgeInsetsDirectional.fromSTEB(6, 0, 0, 3),
  14. Widget prefixIcon = const Icon(CupertinoIcons.search),
  15. EdgeInsetsGeometry suffixInsets = const EdgeInsetsDirectional.fromSTEB(0, 0, 5, 2),
  16. Icon suffixIcon = const Icon(CupertinoIcons.xmark_circle_fill),
  17. OverlayVisibilityMode suffixMode = OverlayVisibilityMode.editing,
  18. VoidCallback? onSuffixTap,
  19. String? restorationId,
  20. SmartQuotesType? smartQuotesType,
  21. SmartDashesType? smartDashesType,
  22. bool? enableIMEPersonalizedLearning,
  23. bool? autocorrect,
  24. bool? enabled,
  25. EdgeInsetsGeometry? padding,
  26. Color? backgroundColor,
  27. TextStyle? placeholderStyle,
  28. TextStyle? style,
  29. String? placeholder,
})

Implementation

CupertinoSearchBarData({
  //Common
  super.widgetKey,
  super.controller,
  super.focusNode,
  super.onTap,
  super.onChanged,
  super.autofocus,
  super.keyboardType,

  //Cupertino
  this.onSubmitted,
  this.decoration,
  this.borderRadius,
  this.itemColor = CupertinoColors.secondaryLabel,
  this.itemSize = 20.0,
  this.prefixInsets = const EdgeInsetsDirectional.fromSTEB(6, 0, 0, 3),
  this.prefixIcon = const Icon(CupertinoIcons.search),
  this.suffixInsets = const EdgeInsetsDirectional.fromSTEB(0, 0, 5, 2),
  this.suffixIcon = const Icon(CupertinoIcons.xmark_circle_fill),
  this.suffixMode = OverlayVisibilityMode.editing,
  this.onSuffixTap,
  this.restorationId,
  this.smartQuotesType,
  this.smartDashesType,
  this.enableIMEPersonalizedLearning,
  this.autocorrect,
  this.enabled,
  this.padding,
  this.backgroundColor,
  this.placeholderStyle,
  this.style,
  this.placeholder,
})  : assert(
        !((decoration != null) && (backgroundColor != null)),
        'Cannot provide both a background color and a decoration\n'
        'To provide both, use "decoration: BoxDecoration(color: '
        'backgroundColor)"',
      ),
      assert(
        !((decoration != null) && (borderRadius != null)),
        'Cannot provide both a border radius and a decoration\n'
        'To provide both, use "decoration: BoxDecoration(borderRadius: '
        'borderRadius)"',
      );