基础库
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
490 B

  1. /// 判空工具类
  2. class EmptyUtil {
  3. /// 判断是否为空,object的类型可以为:String Map List
  4. static bool isEmpty(Object object) {
  5. if (null == object) return true;
  6. if (object is String && (object.isEmpty || object.length == 0)) {
  7. return true;
  8. }
  9. if (object is List && (object.isEmpty || object.length == 0)) {
  10. return true;
  11. }
  12. if (object is Map && (object.isEmpty || object.length == 0)) {
  13. return true;
  14. }
  15. return false;
  16. }
  17. }