我是廣告,點擊一下吧!
標籤
#Flutter (17) 、 #PHP (9) 、 #Laravel (7) 、 #MySQL (5) 、 #Mac (5) 、 #Dart (5) 、 #Android (3) 、 #List (2) 、 #Widget (2) 、 #Carbon (2) 、 #IDE (2) 、 #VS Code (2) 、 #Linux (2) 、 #Shell Script (2) 、 #Cursor Pagination (1) 、 #Pagination (1) 、 #floorMonth (1) 、 #subMonthNoOverflow (1) 、 #資安 (1) 、 #addMonthNoOverflow (1) 、 #subMonth (1) 、 #MySQL 效能 (1) 、 #Mac M1 (1) 、 #個人空間 (1) 、 #Android Splash Screen (1) 、 #Android vector (1) 、 #SVG (1) 、 #Directory Structure (1) 、 #SQL Injection (1) 、 #createFromTimestamp (1)當在寫註解時,可在 class 或是 function 甚至是變數前使用三個斜線,這樣其他開發者在使用時就可以直接看到註解,方便其他人理解。



class PhoneValidator implements SingleInterfaces {
/// 檢查的值
final String _value;
/// 自訂失敗訊息
final String? msg;
/// 檢查是否為台灣手機號碼
PhoneValidator(this._value, {this.msg});
@override
String? validate() {
RegExp mobileRegExp = RegExp(r"^09\d{8}$");
if (!mobileRegExp.hasMatch(_value)) {
return msg ?? i18n.validatorDefaultMsg;
}
return null;
}
}