Skip to content

Write iOS&Android Code using Dart. This package liberates you from redundant glue code and low performance of Flutter Channel.

Notifications You must be signed in to change notification settings

kingstal/dart_native

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

310 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dart_native

Write native code using Dart. This package liberates you from native code and low performance channel.

Still under development!!!

pub package Build Status

This is the blue part(DartNative Bridge) in the picture below:

Requirements

Flutter 1.20.2 (Dart 2.9.1)

Getting Started

Dart code:

// new Objective-C object.
RuntimeStub stub = RuntimeStub();

// Dart function will be converted to Objective-C block.
Block block = stub.fooBlock((NSObject a) {
    print('hello block! ${a.toString()}');
    return 101;
});

// invoke Objective-C block.
int result = block.invoke([stub]);
print(result); 

// support built-in structs.
CGRect rect = stub.fooCGRect(CGRect(4, 3, 2, 1));
print(rect);

Objective-C code:

typedef int(^BarBlock)(NSObject *a);

@interface RuntimeStub

- (CGRect)fooCGRect:(CGRect)rect;
- (BarBlock)fooBlock:(BarBlock)block;

@end

Document

  1. dart_native README.md
  2. dart_native_gen README.md

Article

TODO List

  • Unit test.
  • Documents.

About

Write iOS&Android Code using Dart. This package liberates you from redundant glue code and low performance of Flutter Channel.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C 48.5%
  • Dart 30.6%
  • Objective-C 11.6%
  • Objective-C++ 3.0%
  • C++ 3.0%
  • Java 1.7%
  • Other 1.6%