21 lines
359 B
Dart
21 lines
359 B
Dart
class StringUtils {
|
|
static bool isEmpty(String? value) {
|
|
if (value == null || value == "") {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
static bool isNumber(String? value) {
|
|
if (isEmpty(value)) {
|
|
return false;
|
|
}
|
|
try {
|
|
double num = double.parse(value!);
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|