Skip to content

Commit a2421ab

Browse files
committed
Fix "'elementAt' is deprecated and shouldn't be used. Use operator + instead."
1 parent ac4faea commit a2421ab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

objectbox/lib/src/native/bindings/helpers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ T withNativeStrings<T>(
183183
return fn(ptr, size);
184184
} finally {
185185
for (var i = 0; i < size; i++) {
186-
malloc.free(ptr.elementAt(i).value);
186+
malloc.free((ptr + i).value);
187187
}
188188
malloc.free(ptr);
189189
}

objectbox/lib/src/native/query/query.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ class Query<T> implements Finalizable {
11491149
final count = resultPtr.ref.count;
11501150
return List.generate(count, (i) {
11511151
// items[i] only available with Dart 3.3
1152-
final item = items.elementAt(i).ref;
1152+
final item = (items + i).ref;
11531153
final id = item.id;
11541154
final score = item.score;
11551155
return IdWithScore(id, score);

0 commit comments

Comments
 (0)