提交 22180c2f authored 作者: shixiaochen's avatar shixiaochen

1、优化containsKey方法;

上级 077207c7
......@@ -26,10 +26,10 @@ extension IterableExt<E> on Iterable<E>? {
return this == null || this!.isEmpty;
}
bool containsKey(elementKey, {String key = "id"}) {
bool containsKey(Map<String, dynamic>? element, {String key = "id"}) {
if (this == null) return false;
for (E e in this!) {
if ((e as Map?)?[key] == elementKey) return true;
if ((e as Map?)?[key] == element?[key]) return true;
}
return false;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论