Procházet zdrojové kódy

1、空类型判断的完善

tags/0.0.1
PH2 před 4 roky
rodič
revize
54ed4e9f7f
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. +3
    -3
      lib/util/empty_util.dart

+ 3
- 3
lib/util/empty_util.dart Zobrazit soubor

@@ -4,14 +4,14 @@ class EmptyUtil {
/// 判断是否为空,object的类型可以为:String Map List
static bool isEmpty(Object object) {
if (null == object) return true;
if (object is String && object.isEmpty) {
if (object is String && (object.isEmpty || object.length == 0)) {
return true;
}
if (object is List && object.isEmpty) {
if (object is List && (object.isEmpty || object.length == 0)) {
return true;
}

if (object is Map && object.isEmpty) {
if (object is Map && (object.isEmpty || object.length == 0)) {
return true;
}
return false;


Načítá se…
Zrušit
Uložit