Skip to content

Commit 3156d7c

Browse files
ffigen: adjust to obx_data_visitor being NativeFunction already (#14)
1 parent 4bcf060 commit 3156d7c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

+4-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bool Function(Pointer<Uint8> data, int size) _callback = _callback;
2222
int _forwarder(Pointer<Void> _, Pointer<Void> dataPtr, int size) =>
2323
_callback(dataPtr.cast<Uint8>(), size) ? 1 : 0;
2424

25-
final Pointer<NativeFunction<obx_data_visitor>> _nativeVisitor =
25+
final Pointer<obx_data_visitor> _nativeVisitor =
2626
Pointer.fromFunction(_forwarder, 0);
2727

2828
/// The callback for reading data one-by-one.
@@ -31,18 +31,15 @@ final Pointer<NativeFunction<obx_data_visitor>> _nativeVisitor =
3131
/// - [size] specifies the length of the read data.
3232
/// - Return true to keep going, false to cancel.
3333
@pragma('vm:prefer-inline')
34-
Pointer<NativeFunction<obx_data_visitor>> dataVisitor(
34+
Pointer<obx_data_visitor> dataVisitor(
3535
bool Function(Pointer<Uint8> data, int size) callback) {
3636
_callback = callback;
3737
return _nativeVisitor;
3838
}
3939

4040
@pragma('vm:prefer-inline')
41-
Pointer<NativeFunction<obx_data_visitor>> objectCollector<T>(
42-
List<T> list,
43-
Store store,
44-
EntityDefinition<T> entity,
45-
ObjectCollectorError outError) =>
41+
Pointer<obx_data_visitor> objectCollector<T>(List<T> list, Store store,
42+
EntityDefinition<T> entity, ObjectCollectorError outError) =>
4643
dataVisitor((Pointer<Uint8> data, int size) {
4744
try {
4845
list.add(entity.objectFromFB(

0 commit comments

Comments
 (0)