SimpleAddressSearchField constructor
const
SimpleAddressSearchField({
- Key? key,
- String? hintText = "Search address",
- String? labelText,
- String languageCode = "en",
- List? regionCodes,
- TextEditingController? textEditingController,
- InputDecoration? inputDecoration,
- String? validator(
- dynamic value
- int minInputLength = 3,
- required ValueChanged<
Address?> onSelected, - required String googleApiKey,
A simple address search field that uses Google Places API to fetch address suggestions.
The googleApiKey is required to use the Google Places API.
The onSelected callback is called when an address is selected.
The minInputLength specifies the minimum number of characters required to start searching.
The languageCode specifies the language for the address suggestions.
The regionCodes specifies the region codes to restrict the search to.
The textEditingController can be used to control the text field.
The inputDecoration can be used to customize the appearance of the text field.
The validator can be used to validate the input.
The labelText is the label for the text field.
The hintText is the hint text for the text field.
Implementation
const SimpleAddressSearchField({
super.key,
this.hintText = "Search address",
this.labelText,
this.languageCode = "en",
this.regionCodes,
this.textEditingController,
this.inputDecoration,
this.validator,
this.minInputLength = 3,
required this.onSelected,
required this.googleApiKey,
});