LocaleExpander.withProvider constructor

LocaleExpander.withProvider(
  1. DataProvider provider
)

Create a new LocaleExpander using a new_common data source.

See the Rust documentation for new_common for more information.

Throws DataError on failure.

Implementation

factory LocaleExpander.withProvider(DataProvider provider) {
  final result = _icu4x_LocaleExpander_create_common_with_provider_mv1(provider._ffi);
  if (!result.isOk) {
    throw DataError.values[result.union.err];
  }
  return LocaleExpander._fromFfi(result.union.ok, []);
}