withRegex static method

NumberInputFormatter? withRegex(
  1. String regexString
)

Implementation

static NumberInputFormatter? withRegex(String regexString) {
  try {
    final regex = RegExp(regexString);
    return NumberInputFormatter._(regex);
  } catch (e) {
    // Something not right with regex string.
    assert(false, e.toString());
  }
  return null;
}