AddressAutocompleteTextField constructor

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

Implementation

const AddressAutocompleteTextField({
  super.key,
  required this.mapsApiKey,
  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(
          (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');