isValidMacAddress static method

bool isValidMacAddress(
  1. String mac
)

Validates if the given string is a valid MAC address.

Implementation

static bool isValidMacAddress(String mac) {
  final regex = RegExp(r'^[0-9A-Fa-f]{2}(:[0-9A-Fa-f]{2}){5}\$');
  return regex.hasMatch(mac);
}