Open bsutton opened 3 years ago
Codegen is a tool for generating dart bindings for native APIs. You can use codegen with file or folder path. But it's still under development and may have errors when processing complicated grammar. We are working hard on it.
You can also use dart_native without codegen. For example:
Here is OC code:
@interface RuntimeStub : NSObject
- (BOOL)fooBOOL:(BOOL)b;
@end
You can write your dart binding code instead of using codegen:
class RuntimeStub extends NSObject {
RuntimeStub([Class isa]) : super(isa ?? Class('RuntimeStub'));
RuntimeStub.fromPointer(Pointer<Void> ptr) : super.fromPointer(ptr);
bool fooBOOL(bool b) {
return perform(SEL('fooBOOL:'), args: [b]);
}
}
Last, call native API using Dart:
RuntimeStub stub = RuntimeStub();
bool resultBool = stub.fooBOOL(false);
print('fooBool result:$resultBool');
We had fixed the performance issue since 1.2.0
I'm trying to generate the dart_native dart code for the ios AVFoundation framework.
When I run code gen it appears to be generating all of the files however it is generating a large no of errors (attached file).
As I'm writing this I'm also waiting for it to complete. It appears to have generated all of the files but is now sitting churning cpu and not doing much (15+ minutes)
The errors and generated code.
error.zip
code.zip