CustomPlaceAutoComplete constructor
const
CustomPlaceAutoComplete({
- Key? key,
- required String apiKey,
- String? language,
- EdgeInsetsGeometry topCardMargin = const EdgeInsets.all(8),
- Color? topCardColor,
- ShapeBorder topCardShape = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8))),
- BorderRadiusGeometry borderRadius = const BorderRadius.all(Radius.circular(8)),
- String searchHintText = "Start typing to search",
- bool hideBackButton = false,
- Widget? backButton,
- Client? placesHttpClient,
- Map<
String, String> ? placesApiHeaders, - String? placesBaseUrl,
- String? sessionToken,
- Offset? offset,
- Location? origin,
- Location? location,
- num? radius,
- String? region,
- List<
String> fields = const [], - List<
String> types = const [], - List<
Component> components = const [], - bool strictbounds = false,
- TextEditingController? searchController,
- required bool mounted,
- void onGetDetailsByPlaceId(
- PlacesDetailsResponse?, {
- Prediction? searchedPlace,
- void onSelected(
- Prediction
- bool showClearButton = true,
- Widget? suffixIcon,
- Widget? prefixIcon,
- Widget? trailingIcon,
- Prediction? initialValue,
- String? validator(
- Prediction?
- Widget itemBuilder(
- BuildContext,
- Prediction
- Duration animationDuration = const Duration(milliseconds: 500),
- bool autoFlipDirection = false,
- TextEditingController? controller,
- Duration debounceDuration = const Duration(milliseconds: 300),
- VerticalDirection direction = VerticalDirection.down,
- Widget errorBuilder()?,
- bool hideOnEmpty = false,
- bool hideOnError = false,
- bool hideOnLoading = false,
- WidgetBuilder? loadingBuilder,
- ScrollController? scrollController,
- InputDecoration? decoration,
- dynamic valueTransformer(
- Prediction?
- bool enabled = true,
- AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
- void onChanged(
- Prediction?
- void onReset()?,
- void onSaved(
- Prediction?
- FocusNode? focusNode,
- EdgeInsets minimum = EdgeInsets.zero,
- bool bottom = true,
- bool left = true,
- bool maintainBottomViewPadding = false,
- bool right = true,
- bool top = true,
- int minCharsForSuggestions = 3,
- Widget transitionBuilder()?,
- bool autoFlipListDirection = true,
- double autoFlipMinHeight = 64.0,
- BoxConstraints? constraints,
- TextField? customTextField,
- Widget decorationBuilder()?,
- Widget emptyBuilder()?,
- bool hideKeyboardOnDrag = false,
- bool hideOnSelect = true,
- bool hideOnUnfocus = true,
- bool hideWithKeyboard = true,
- Widget itemSeparatorBuilder()?,
- Widget listBuilder()?,
- bool retainOnLoading = true,
- bool showOnFocus = true,
- SuggestionsController<
Prediction> ? suggestionsController, - num? offsetParameter,
- dynamic onTextChange()?,
Implementation
const CustomPlaceAutoComplete({
super.key,
required this.apiKey,
this.language,
this.topCardMargin = const EdgeInsets.all(8),
this.topCardColor,
this.topCardShape = const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8)),
),
this.borderRadius = const BorderRadius.all(Radius.circular(8)),
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.searchController,
required this.mounted,
this.onGetDetailsByPlaceId,
this.onSelected,
this.showClearButton = true,
this.suffixIcon,
this.prefixIcon,
this.trailingIcon,
this.initialValue,
this.validator,
this.itemBuilder,
this.animationDuration = const Duration(milliseconds: 500),
this.autoFlipDirection = false,
this.controller,
this.debounceDuration = const Duration(milliseconds: 300),
this.direction = VerticalDirection.down,
this.errorBuilder,
this.hideOnEmpty = false,
this.hideOnError = false,
this.hideOnLoading = false,
this.loadingBuilder,
this.scrollController,
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,
this.minCharsForSuggestions = 3,
this.transitionBuilder,
this.autoFlipListDirection = true,
this.autoFlipMinHeight = 64.0,
this.constraints,
this.customTextField,
this.decorationBuilder,
this.emptyBuilder,
this.hideKeyboardOnDrag = false,
this.hideOnSelect = true,
this.hideOnUnfocus = true,
this.hideWithKeyboard = true,
this.itemSeparatorBuilder,
this.listBuilder,
this.retainOnLoading = true,
this.showOnFocus = true,
this.suggestionsController,
this.offsetParameter,
this.onTextChange,
});