CitySearchField constructor
const
CitySearchField({
- required String countryIso2,
- Key? key,
- int? initialCityId,
- String? initialCityName,
- ValueChanged<
CitySearchResult?> ? onChanged, - CountrifyFieldStyle? style,
- GeoPickerTheme? pickerTheme,
- GeoPickerConfig? pickerConfig,
- String? placeholder,
- String? emptyPlaceholder,
- bool enabled = true,
- FocusNode? focusNode,
- GeoRepository? repository,
A searchable text field that searches across all cities for a given country without requiring a pre-selected state. When a city is selected the parent state is resolved automatically.
CitySearchField(
countryIso2: 'US',
onChanged: (result) {
if (result != null) {
print('${result.city.name}, ${result.state.name}');
}
},
)
Implementation
const CitySearchField({
required this.countryIso2,
super.key,
this.initialCityId,
this.initialCityName,
this.onChanged,
this.style,
this.pickerTheme,
this.pickerConfig,
this.placeholder,
this.emptyPlaceholder,
this.enabled = true,
this.focusNode,
this.repository,
});