LocaleFallbacker.withProvider constructor

LocaleFallbacker.withProvider(
  1. DataProvider provider
)

Creates a new LocaleFallbacker from a data provider.

See the Rust documentation for new for more information.

Throws DataError on failure.

Implementation

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