ListFormatter.orWithLength constructor
- Locale locale,
- ListLength length
Construct a new ListFormatter instance for And patterns from compiled data.
See the Rust documentation for try_new_or
for more information.
Throws DataError on failure.
Implementation
factory ListFormatter.orWithLength(Locale locale, ListLength length) {
final result = _icu4x_ListFormatter_create_or_with_length_mv1(locale._ffi, length.index);
if (!result.isOk) {
throw DataError.values[result.union.err];
}
return ListFormatter._fromFfi(result.union.ok, []);
}