normalize method

String normalize(
  1. String text
)

Apply ENS normalization to a string.

Raises DisallowedSequence if the input cannot be normalized. e.g

ENSNormalize ensn = await ENSNormalize.getInstance();
String normalized = ensn.normalize('Nick.ETH');
// nick.eth

Implementation

String normalize(String text) {
  var res = ensProcess(text, doNormalize: true);
  if (res.error != null) {
    throw res.error!;
  }
  return res.normalized!;
}