CupertinoSearchBarData constructor

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

  //Cupertino
  this.onSubmitted,
  this.decoration,
  this.borderRadius,
  this.keyboardType,
  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 = true,
  this.autofocus = false,
  this.autocorrect = true,
  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)"',
      );