isTime method

bool isTime(
  1. String? time
)

验证时间格式 (HH:MM:SS)

Implementation

bool isTime(String? time) {
  const pattern = r'^([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$';
  return hasMatch(time, pattern);
}