EditAddressWidget<T extends PickerItemModel> class

translateError provide a function which maps the city and street validation errors from the service service to the appropriate RxFieldException<String>, which is an ui error with text.

service receives an implementation of the EditAddressService class. The API of the class provides methods for the logic for the main save address button, fetching of the list of countries, filtering the countries list, validating the city and street values while typing and when pressing the save button for each of them. Some methods have default implementation. For more information, check the documentation in the file EditAddressService class.

onChanged receives a function, which accepts the edited address model and it is invoked when some of its property changes.

onSaved receives a function, which accepts the edited address model and it is invoked when the model is saved and the dialog is dismissed.

initialAddress is the current address information, which is provided to be displayed in the widgets inside the page.

searchCountryBuilders is a class which accepts showEmptyWidgetWhenNoResultsAreFound, custom item builder, error builder, empty builder, separator builder for the search country item picker

editContactAddressErrorBuilder is a custom error builder for the contact address modal sheet

localizedStrings receives a class, which should implement EditAddressLocalizedStrings, it should provided translation for the strings in the package.

configuration is a configuration for the edit address bottom sheet.

type depending on the selected type, a different type of modal bottom sheet is displayed. Currently choosing UserProfileCardTypes.permanentAddress displays a permanent address bottom sheet.

textFieldsModalConfiguration is the configuration for the city and street bottom sheets.

countryPickerModalConfiguration is the configuration for the country picker.

Inheritance

Constructors

EditAddressWidget.new({required dynamic translateError(Object error), required EditAddressService<T> service, dynamic onChanged(AddressModel? addressModel)?, dynamic onSaved(AddressModel addressModel)?, AddressModel initialAddress = _defaultAddressModel, SearchCountryCustomBuilders<T>? searchCountryBuilders, Widget editContactAddressErrorBuilder(ErrorModel?)?, EditAddressLocalizedStrings? localizedStrings, UserProfileCardTypes type = UserProfileCardTypes.mailingAddress, EditAddressConfiguration configuration = const EditAddressConfiguration(), TextFieldModalConfiguration textFieldsModalConfiguration = const TextFieldModalConfiguration(), SearchPickerModalConfiguration countryPickerModalConfiguration = const SearchPickerModalConfiguration(), Key? key})
const

Properties

configuration EditAddressConfiguration
final
countryPickerModalConfiguration SearchPickerModalConfiguration
final
editContactAddressErrorBuilder Widget Function(ErrorModel?)?
final
hashCode int
The hash code for this object.
no setterinherited
initialAddress AddressModel
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
localizedStrings EditAddressLocalizedStrings?
final
onChanged → dynamic Function(AddressModel? addressModel)?
final
onSaved → dynamic Function(AddressModel addressModel)?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchCountryBuilders SearchCountryCustomBuilders<T>?
final
service EditAddressService<T>
final
textFieldsModalConfiguration TextFieldModalConfiguration
final
translateError → dynamic Function(Object error)
final
type UserProfileCardTypes
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<EditAddressWidget<PickerItemModel>>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited