dart_native_gen 0.0.6 copy "dart_native_gen: ^0.0.6" to clipboard
dart_native_gen: ^0.0.6 copied to clipboard

outdated

Annotation for dart_native.

dart_native_gen #

Annotation for dart_native.

Description #

Automatic type conversion solution for dart_native based on source_gen through annotation.

Getting Started #

  1. Annotate a Dart wrapper class with @native.
@native
class RuntimeSon extends RuntimeStub {
  RuntimeSon([Class isa]) : super(Class('RuntimeSon'));
  RuntimeSon.fromPointer(Pointer<Void> ptr) : super.fromPointer(ptr);
}
  1. Annotate your own entry class with @nativeRoot:
@nativeRoot
void main() {
  runDartNativeExample();
  runApp(Platform.isAndroid ? AndroidNewApp() : IOSApp());
}
  1. just run the command below in your workspace build:
flutter packages pub run build_runner build --delete-conflicting-outputs

suggest you running the clean command before build:

flutter packages pub run build_runner clean

Installation #

add packages to dependencies in your pubspec.yaml example:

dependencies:
  dart_native_gen: any
3
likes
0
pub points
56%
popularity

Publisher

unverified uploader

Annotation for dart_native.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, build, flutter, source_gen

More

Packages that depend on dart_native_gen