PlacesAutocomplete constructor
const
PlacesAutocomplete({
- Key? key,
- required String apiKey,
- String? language,
- EdgeInsetsGeometry topCardMargin = const EdgeInsets.all(8),
- Color? topCardColor,
- ShapeBorder topCardShape = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))),
- BorderRadiusGeometry borderRadius = const BorderRadius.all(Radius.circular(12)),
- String searchHintText = "Start typing to search",
- bool hideBackButton = false,
- Widget? backButton,
- Client? placesHttpClient,
- Map<
String, String> ? placesApiHeaders, - String? placesBaseUrl,
- String? sessionToken,
- num? offset,
- Location? origin,
- Location? location,
- num? radius,
- String? region,
- List<
String> fields = const [], - List<
String> types = const [], - List<
Component> components = const [], - bool strictbounds = false,
- bool hideSuggestionsOnKeyboardHide = false,
- TextEditingController? searchController,
- required bool mounted,
- void onGetDetailsByPlaceId()?,
- void onSuggestionSelected()?,
- bool showClearButton = true,
- Widget? suffixIcon,
- Prediction? initialValue,
- String? validator()?,
- Widget itemBuilder()?,
- Duration animationDuration = const Duration(milliseconds: 500),
- double animationStart = 0.25,
- bool autoFlipDirection = false,
- TextEditingController? controller,
- Duration debounceDuration = const Duration(milliseconds: 300),
- AxisDirection direction = AxisDirection.down,
- Widget errorBuilder()?,
- bool getImmediateSuggestions = false,
- bool hideKeyboard = false,
- bool hideOnEmpty = false,
- bool hideOnError = false,
- bool hideOnLoading = false,
- bool keepSuggestionsOnLoading = true,
- bool keepSuggestionsOnSuggestionSelected = false,
- WidgetBuilder? loadingBuilder,
- WidgetBuilder? noItemsFoundBuilder,
- ScrollController? scrollController,
- SuggestionsBoxController? suggestionsBoxController,
- SuggestionsBoxDecoration suggestionsBoxDecoration = const SuggestionsBoxDecoration(),
- double suggestionsBoxVerticalOffset = 5.0,
- TextFieldConfiguration textFieldConfiguration = const TextFieldConfiguration(),
- AnimationTransitionBuilder? transitionBuilder,
- InputDecoration? decoration,
- dynamic valueTransformer()?,
- bool enabled = true,
- AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
- void onChanged()?,
- void onReset()?,
- void onSaved()?,
- FocusNode? focusNode,
- EdgeInsets minimum = EdgeInsets.zero,
- bool bottom = true,
- bool left = true,
- bool maintainBottomViewPadding = false,
- bool right = true,
- 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);