toUri static method

Uri toUri(
  1. dynamic object, {
  2. dynamic mapKey,
  3. int? listIndex,
  4. Uri? defaultValue,
  5. ElementConverter<Uri>? converter,
})

Converts object to Uri, honoring UriOptions from ConvertConfig.

Email addresses and phone numbers are coerced to mailto: and tel: URIs. Throws ConversionException when parsing fails and defaultValue is null.

Implementation

static Uri toUri(
  dynamic object, {
  dynamic mapKey,
  int? listIndex,
  Uri? defaultValue,
  ElementConverter<Uri>? converter,
}) => ConvertObjectImpl.toUri(
  object,
  mapKey: mapKey,
  listIndex: listIndex,
  defaultValue: defaultValue,
  converter: converter,
);