From 54ed4e9f7f6f40c6cea85c15083d3cee8dbd8b72 Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Thu, 22 Oct 2020 17:43:27 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E7=A9=BA=E7=B1=BB=E5=9E=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E7=9A=84=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util/empty_util.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/util/empty_util.dart b/lib/util/empty_util.dart index 22691df..a0f6b62 100644 --- a/lib/util/empty_util.dart +++ b/lib/util/empty_util.dart @@ -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;