isAddress static method

bool isAddress(
  1. String input
)

Check if input is an address

Implementation

static bool isAddress(String input) {
  final addressFormt = RegExp(r'^0x[0-9a-f]{40}$', caseSensitive: false);
  if (addressFormt.hasMatch(input)) {
    return true;
  } else {
    return false;
  }
}