equalsKeys method
Used to check for updates with keys
when trying to update with setState in didUpdateValue.
Checks all contents of keys1
and keys2
and returns true
if all values are the same.
didUpdateValueでsetStateで更新しようとする際、keys
で更新チェックを行うために利用します。
keys1
とkeys2
の中身をすべてチェックしすべての値が同じな場合はtrue
を返します。
Implementation
@protected
bool equalsKeys(List<Object> keys1, List<Object> keys2) {
if (keys1 == keys2) {
return true;
}
if (keys1.length != keys2.length) {
return false;
}
final i1 = keys1.iterator;
final i2 = keys2.iterator;
while (true) {
if (!i1.moveNext() || !i2.moveNext()) {
return true;
}
if (i1.current != i2.current) {
return false;
}
}
}