format method

String format({
  1. List<AddressField>? excludeFields,
  2. List<AddressField>? includeFields,
})

Formats the address as a single human-readable string.

The returned string contains the address fields joined in a sensible order for display. Use excludeFields to omit specific components or includeFields to include only a selected subset.

Parameters

  • excludeFields: Optional list of fields to exclude from the formatted result. If omitted, no fields are excluded.
  • includeFields: Optional list of fields to include. If omitted, all available fields are considered.

Returns

  • String: The formatted address.

Implementation

String format({
  final List<AddressField>? excludeFields,
  final List<AddressField>? includeFields,
}) {
  final OperationResult resultString = objectMethod(
    pointerId,
    'AddressInfo',
    'format',
    args: <String, dynamic>{
      if (excludeFields != null)
        'excludeFields': excludeFields
            .map((final AddressField e) => e.id)
            .toList(),
      if (includeFields != null)
        'includeFields': includeFields
            .map((final AddressField e) => e.id)
            .toList(),
    },
  );

  return resultString['result'];
}