PlacesAutocomplete constructor

const PlacesAutocomplete({
  1. Key? key,
  2. required String apiKey,
  3. String? language,
  4. EdgeInsetsGeometry topCardMargin = const EdgeInsets.all(8),
  5. Color? topCardColor,
  6. ShapeBorder topCardShape = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))),
  7. BorderRadiusGeometry borderRadius = const BorderRadius.all(Radius.circular(12)),
  8. String searchHintText = "Start typing to search",
  9. bool hideBackButton = false,
  10. Widget? backButton,
  11. Client? placesHttpClient,
  12. Map<String, String>? placesApiHeaders,
  13. String? placesBaseUrl,
  14. String? sessionToken,
  15. num? offset,
  16. Location? origin,
  17. Location? location,
  18. num? radius,
  19. String? region,
  20. List<String> fields = const [],
  21. List<String> types = const [],
  22. List<Component> components = const [],
  23. bool strictbounds = false,
  24. bool hideSuggestionsOnKeyboardHide = false,
  25. TextEditingController? searchController,
  26. required bool mounted,
  27. void onGetDetailsByPlaceId(
    1. PlacesDetailsResponse?
    )?,
  28. void onSuggestionSelected(
    1. Prediction
    )?,
  29. bool showClearButton = true,
  30. Widget? suffixIcon,
  31. Prediction? initialValue,
  32. String? validator(
    1. Prediction?
    )?,
  33. Widget itemBuilder(
    1. BuildContext,
    2. Prediction
    )?,
  34. Duration animationDuration = const Duration(milliseconds: 500),
  35. double animationStart = 0.25,
  36. bool autoFlipDirection = false,
  37. TextEditingController? controller,
  38. Duration debounceDuration = const Duration(milliseconds: 300),
  39. AxisDirection direction = AxisDirection.down,
  40. Widget errorBuilder(
    1. BuildContext,
    2. Object?
    )?,
  41. bool getImmediateSuggestions = false,
  42. bool hideKeyboard = false,
  43. bool hideOnEmpty = false,
  44. bool hideOnError = false,
  45. bool hideOnLoading = false,
  46. bool keepSuggestionsOnLoading = true,
  47. bool keepSuggestionsOnSuggestionSelected = false,
  48. WidgetBuilder? loadingBuilder,
  49. WidgetBuilder? noItemsFoundBuilder,
  50. ScrollController? scrollController,
  51. SuggestionsBoxController? suggestionsBoxController,
  52. SuggestionsBoxDecoration suggestionsBoxDecoration = const SuggestionsBoxDecoration(),
  53. double suggestionsBoxVerticalOffset = 5.0,
  54. TextFieldConfiguration textFieldConfiguration = const TextFieldConfiguration(),
  55. AnimationTransitionBuilder? transitionBuilder,
  56. InputDecoration? decoration,
  57. dynamic valueTransformer(
    1. Prediction?
    )?,
  58. bool enabled = true,
  59. AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
  60. void onChanged(
    1. Prediction?
    )?,
  61. void onReset()?,
  62. void onSaved(
    1. Prediction?
    )?,
  63. FocusNode? focusNode,
  64. EdgeInsets minimum = EdgeInsets.zero,
  65. bool bottom = true,
  66. bool left = true,
  67. bool maintainBottomViewPadding = false,
  68. bool right = true,
  69. bool top = true,
})

Implementation

const PlacesAutocomplete({
  Key? key,
  required this.apiKey,
  this.language,
  this.topCardMargin = const EdgeInsets.all(8),
  this.topCardColor,
  this.topCardShape = const RoundedRectangleBorder(
    borderRadius: BorderRadius.all(Radius.circular(12)),
  ),
  this.borderRadius = const BorderRadius.all(Radius.circular(12)),
  this.searchHintText = "Start typing to search",
  this.hideBackButton = false,
  this.backButton,
  this.placesHttpClient,
  this.placesApiHeaders,
  this.placesBaseUrl,
  this.sessionToken,
  this.offset,
  this.origin,
  this.location,
  this.radius,
  this.region,
  this.fields = const [],
  this.types = const [],
  this.components = const [],
  this.strictbounds = false,
  this.hideSuggestionsOnKeyboardHide = false,
  this.searchController,
  required this.mounted,
  this.onGetDetailsByPlaceId,
  this.onSuggestionSelected,
  this.showClearButton = true,
  this.suffixIcon,
  this.initialValue,
  this.validator,
  this.itemBuilder,
  this.animationDuration = const Duration(milliseconds: 500),
  this.animationStart = 0.25,
  this.autoFlipDirection = false,
  this.controller,
  this.debounceDuration = const Duration(milliseconds: 300),
  this.direction = AxisDirection.down,
  this.errorBuilder,
  this.getImmediateSuggestions = false,
  this.hideKeyboard = false,
  this.hideOnEmpty = false,
  this.hideOnError = false,
  this.hideOnLoading = false,
  this.keepSuggestionsOnLoading = true,
  this.keepSuggestionsOnSuggestionSelected = false,
  this.loadingBuilder,
  this.noItemsFoundBuilder,
  this.scrollController,
  this.suggestionsBoxController,
  this.suggestionsBoxDecoration = const SuggestionsBoxDecoration(),
  this.suggestionsBoxVerticalOffset = 5.0,
  this.textFieldConfiguration = const TextFieldConfiguration(),
  this.transitionBuilder,
  this.decoration,
  this.valueTransformer,
  this.enabled = true,
  this.autovalidateMode = AutovalidateMode.disabled,
  this.onChanged,
  this.onReset,
  this.onSaved,
  this.focusNode,
  this.minimum = EdgeInsets.zero,
  this.bottom = true,
  this.left = true,
  this.maintainBottomViewPadding = false,
  this.right = true,
  this.top = true,
}) : super(key: key);