This commit is contained in:
nyne
2024-10-18 16:13:58 +08:00
parent 700630e317
commit 5812cfc701
3 changed files with 11 additions and 4 deletions

View File

@@ -85,8 +85,14 @@ extension StringExt on String{
bool get isNum => double.tryParse(this) != null;
}
class ListOrNull{
abstract class ListOrNull{
static List<T>? from<T>(Iterable<dynamic>? i){
return i == null ? null : List.from(i);
}
}
abstract class MapOrNull{
static Map<K, V>? from<K, V>(Map<dynamic, dynamic>? i){
return i == null ? null : Map<K, V>.from(i);
}
}