验证是否为整数
bool isInteger(String? s) { if (s == null || s.isEmpty) return false; const pattern = r'^-?\d+$'; return hasMatch(s, pattern); }