AddressAutocompleteTextField constructor

const AddressAutocompleteTextField({
  1. Key? key,
  2. String? mapsApiKey,
  3. PlacesApiVersion apiVersion = PlacesApiVersion.placesApiNew,
  4. PlaceApiProvider? placeApiProvider,
  5. String? androidPackageName,
  6. String? androidCertSha1Fingerprint,
  7. String? iosBundleId,
  8. TextEditingController? controller,
  9. FocusNode? focusNode,
  10. String? initialValue,
  11. String prepareQuery(
    1. String address
    )?,
  12. void onClearClick()?,
  13. void onInitialSuggestionClick(
    1. Suggestion suggestion
    )?,
  14. void onSuggestionClick(
    1. Place place
    )?,
  15. void onFinishedEditingWithNoSuggestion(
    1. String text
    )?,
  16. String? onSuggestionClickGetTextToUseForControl(
    1. Place place
    )?,
  17. Widget buildItem(
    1. Suggestion,
    2. int
    )?,
  18. Color? hoverColor,
  19. Color? selectionColor,
  20. Icon? clearButton,
  21. BoxDecoration? suggestionsOverlayDecoration,
  22. InputDecoration? decoration,
  23. double? elevation,
  24. double overlayOffset = 4,
  25. bool showGoogleTradeMark = false,
  26. bool? postalCodeLookup,
  27. AutoCompleteType? type,
  28. List<AutoCompleteType>? types,
  29. int debounceTime = 600,
  30. String? componentCountry,
  31. String? language,
  32. TextInputType? keyboardType,
  33. TextCapitalization textCapitalization = TextCapitalization.none,
  34. TextInputAction? textInputAction,
  35. TextStyle? style,
  36. StrutStyle? strutStyle,
  37. TextAlign textAlign = TextAlign.start,
  38. TextAlignVertical? textAlignVertical,
  39. TextDirection? textDirection,
  40. bool autofocus = false,
  41. bool readOnly = false,
  42. bool? showCursor,
  43. int? maxLines = 1,
  44. int? minLines,
  45. bool expands = false,
  46. int? maxLength,
  47. MaxLengthEnforcement? maxLengthEnforcement,
  48. ValueChanged<String>? onChanged,
})

Implementation

const AddressAutocompleteTextField({
  super.key,
  this.mapsApiKey,
  this.apiVersion = PlacesApiVersion.placesApiNew,
  this.placeApiProvider,
  this.androidPackageName,
  this.androidCertSha1Fingerprint,
  this.iosBundleId,
  this.controller,
  this.focusNode,
  this.initialValue,
  this.prepareQuery,
  this.onClearClick,
  this.onInitialSuggestionClick,
  this.onSuggestionClick,
  this.onFinishedEditingWithNoSuggestion,
  this.onSuggestionClickGetTextToUseForControl,
  this.buildItem,
  this.hoverColor,
  this.selectionColor,
  this.clearButton,
  this.suggestionsOverlayDecoration,
  this.decoration,
  this.elevation,
  this.overlayOffset = 4,
  this.showGoogleTradeMark = false,
  this.postalCodeLookup,
  this.type,
  this.types,
  this.debounceTime = 600,
  this.componentCountry,
  this.language,

  // inherited TextField arguments
  this.keyboardType,
  this.textCapitalization = TextCapitalization.none,
  this.textInputAction,
  this.style,
  this.strutStyle,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,
  this.textDirection,
  this.autofocus = false,
  this.readOnly = false,
  this.showCursor,
  this.maxLines = 1,
  this.minLines,
  this.expands = false,
  this.maxLength,
  this.maxLengthEnforcement,
  this.onChanged,
}) : assert(mapsApiKey != null || placeApiProvider != null,
          'mapsApiKey is required unless a custom placeApiProvider is supplied'),
     assert(
          (postalCodeLookup == true && type == null && types == null) ||
              (postalCodeLookup == false && type == null && types == null) ||
              (postalCodeLookup == null && type == null && types == null) ||
              (postalCodeLookup == null && type != null && types == null) ||
              (postalCodeLookup == null && type == null && types != null),
          'You can only supply value for [type], [types] (or deprecated `postalCodeLookup`).  No combinations allowed');