isValidIdV1 static method

bool isValidIdV1(
  1. String idV1
)

Returns true if the given idV1 conforms to the proper regex pattern or if it is empty.

Regex pattern ^(\/[a-z]{4,32}\/[0-9a-zA-Z-]{1,32})?$

Implementation

static bool isValidIdV1(String idV1) =>
    idV1.isEmpty ||
    RegExp(r"^(\/[a-z]{4,32}\/[0-9a-zA-Z-]{1,32})?$").hasMatch(idV1);