EnhancedGooglePlacesWidget constructor

const EnhancedGooglePlacesWidget({
  1. Key? key,
  2. dynamic onLocationSelected(
    1. LocationResult?
    )?,
  3. dynamic onTextChanged(
    1. String
    )?,
  4. dynamic onSuggestionsChanged(
    1. List<PlacePrediction>
    )?,
  5. String? apiKey,
  6. String? initialValue,
  7. String? country,
  8. List<String> types = const [],
  9. bool enabled = true,
  10. TextEditingController? controller,
  11. InputDecoration? inputDecoration,
  12. TextStyle? textStyle,
  13. TextStyle? hintStyle,
  14. String? hintText = 'Search for a place...',
  15. Widget? prefixIcon,
  16. Widget? suffixIcon,
  17. Widget? loadingWidget,
  18. Widget? clearIcon,
  19. EdgeInsetsGeometry? contentPadding,
  20. BorderRadius? borderRadius,
  21. Border? border,
  22. Border? focusedBorder,
  23. Border? errorBorder,
  24. Color? fillColor,
  25. bool? filled,
  26. double? borderWidth,
  27. Color? borderColor,
  28. Color? focusedBorderColor,
  29. Color? errorBorderColor,
  30. double? suggestionHeight,
  31. double? maxSuggestionHeight = 300,
  32. BorderRadius? suggestionBorderRadius,
  33. Color? suggestionBackgroundColor,
  34. Color? suggestionHoverColor,
  35. Color? suggestionSelectedColor,
  36. double? suggestionElevation = 4,
  37. EdgeInsetsGeometry? suggestionPadding,
  38. TextStyle? suggestionTextStyle,
  39. TextStyle? suggestionSubtextStyle,
  40. Widget customSuggestionBuilder(
    1. PlacePrediction
    )?,
  41. Widget? noResultsWidget,
  42. Widget? errorWidget,
  43. Offset? suggestionOffset,
  44. double? suggestionSpacing = 4,
  45. Widget? locationIcon,
  46. double? iconSize = 20,
  47. Color? iconColor,
  48. EdgeInsetsGeometry? iconPadding,
  49. Duration? debounceDelay = const Duration(milliseconds: 300),
  50. Duration? animationDuration = const Duration(milliseconds: 200),
  51. Curve? animationCurve = Curves.easeInOut,
  52. bool showAnimations = true,
  53. bool autoFocus = false,
  54. bool showClearButton = true,
  55. bool showLoadingIndicator = true,
  56. double? width,
  57. double? height,
  58. EdgeInsetsGeometry? margin,
  59. AlignmentGeometry? alignment,
  60. String? validator(
    1. String?
    )?,
  61. Widget errorBuilder(
    1. String
    )?,
  62. bool showInlineErrors = true,
  63. String? semanticsLabel,
  64. String? semanticsHint,
})

Implementation

const EnhancedGooglePlacesWidget({
  super.key,
  // Core
  this.onLocationSelected,
  this.onTextChanged,
  this.onSuggestionsChanged,
  this.apiKey,
  this.initialValue,
  this.country,
  this.types = const [],
  this.enabled = true,
  this.controller,

  // Input customization
  this.inputDecoration,
  this.textStyle,
  this.hintStyle,
  this.hintText = 'Search for a place...',
  this.prefixIcon,
  this.suffixIcon,
  this.loadingWidget,
  this.clearIcon,
  this.contentPadding,
  this.borderRadius,
  this.border,
  this.focusedBorder,
  this.errorBorder,
  this.fillColor,
  this.filled,
  this.borderWidth,
  this.borderColor,
  this.focusedBorderColor,
  this.errorBorderColor,

  // Suggestions customization
  this.suggestionHeight,
  this.maxSuggestionHeight = 300,
  this.suggestionBorderRadius,
  this.suggestionBackgroundColor,
  this.suggestionHoverColor,
  this.suggestionSelectedColor,
  this.suggestionElevation = 4,
  this.suggestionPadding,
  this.suggestionTextStyle,
  this.suggestionSubtextStyle,
  this.customSuggestionBuilder,
  this.noResultsWidget,
  this.errorWidget,
  this.suggestionOffset,
  this.suggestionSpacing = 4,

  // Icons
  this.locationIcon,
  this.iconSize = 20,
  this.iconColor,
  this.iconPadding,

  // Animation
  this.debounceDelay = const Duration(milliseconds: 300),
  this.animationDuration = const Duration(milliseconds: 200),
  this.animationCurve = Curves.easeInOut,
  this.showAnimations = true,
  this.autoFocus = false,
  this.showClearButton = true,
  this.showLoadingIndicator = true,

  // Layout
  this.width,
  this.height,
  this.margin,
  this.alignment,

  // Error handling
  this.validator,
  this.errorBuilder,
  this.showInlineErrors = true,

  // Accessibility
  this.semanticsLabel,
  this.semanticsHint,
});