Coder Social home page Coder Social logo

strogo / dart_native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dart-native/dart_native

0.0 1.0 0.0 67.9 MB

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

Ruby 0.88% Objective-C 8.74% Dart 23.49% Objective-C++ 2.34% C 59.37% Java 1.39% CMake 0.19% C++ 3.50% Kotlin 0.02% Swift 0.06%

dart_native's Introduction

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:

📲 Requirement

DartNative Version Requirements
0.3.0 Flutter 1.20.0 (Dart 2.9.1)
0.2.0 Flutter 1.12.13 (Dart 2.7)

🌟 Feature

  • Support iOS & Android platform.
  • Sync/Async channel with high performance.
  • Generate Dart bridging code from native code.
  • Automatic object marshalling between Dart and native.

🔮 Getting Started

Dart code:

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

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

// 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;
- (void)fooBlock:(BarBlock)block;

@end

📚 Document

Readme

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

Blog

🐒 Q&A

Q: Failed to lookup symbol (dlsym(RTLD_DEFAULT, InitDartApiDL): symbol not found) on iOS archive.

There are two Workarounds:

  1. Use dynamic library: Add use_frameworks! in Podfile.
  2. Select Target Runner -> Build Settings -> Strip Style -> change from "All Symbols" to "Non-Global Symbols"

❤️ Contributed

  • If you need help or you'd like to ask a general question, open an issue.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

👮🏻 License

DartNative is available under the BSD 3-Clause License. See the LICENSE file for more info.

dart_native's People

Contributors

hui19 avatar siriushe avatar yulingtianxia avatar zhongwuzw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.