ListFormatter.orWithLengthAndProvider constructor

ListFormatter.orWithLengthAndProvider(
  1. DataProvider provider,
  2. Locale locale,
  3. ListLength length
)

Construct a new ListFormatter instance for And patterns

See the Rust documentation for try_new_or for more information.

Throws DataError on failure.

Implementation

factory ListFormatter.orWithLengthAndProvider(DataProvider provider, Locale locale, ListLength length) {
  final result = _icu4x_ListFormatter_create_or_with_length_and_provider_mv1(provider._ffi, locale._ffi, length.index);
  if (!result.isOk) {
    throw DataError.values[result.union.err];
  }
  return ListFormatter._fromFfi(result.union.ok, []);
}