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