Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flutter/Dart] Support Dart: Use Dart FFI #1200

Closed
2 tasks done
hhstore opened this issue Dec 7, 2020 · 8 comments
Closed
2 tasks done

[Flutter/Dart] Support Dart: Use Dart FFI #1200

hhstore opened this issue Dec 7, 2020 · 8 comments
Labels
enhancement New feature or request priority:low

Comments

@hhstore
Copy link

hhstore commented Dec 7, 2020

Support Dart:

  • since i want to use wallet-core in dart.
  • so i try to use dart:ffi to make it.
  • but i am not quite familiar with wallet-core.
  • anyone who wants to help me? or any suggestions on where to start first?
  • i would really appreciate it.

my fork:

dart ffi:

libs:

usage: c++ with ffi

image

Maybe these are the things I need?

docs:

 pod 'TrustWalletCore'

jni load:

init {
    System.loadLibrary("TrustWalletCore")
}

*.h

jni:

gen proto ?

iOS:

Android:

code gen:

@hhstore hhstore added the enhancement New feature or request label Dec 7, 2020
@hhstore
Copy link
Author

hhstore commented Dec 7, 2020

The latest progress:

pubspec.yaml

dart binding file:

@hewigovens
Copy link
Contributor

Are you building dart bindings on top of existing iOS/android lib?

@hhstore
Copy link
Author

hhstore commented Dec 8, 2020

Are you building dart bindings on top of existing iOS/android lib?

about dart ffi usage:

image

rust + ffi + flutter:

image

@hewigovens
Copy link
Contributor

Hey, what's status of dart binding? I think you can skip building process and unzip aar from here https://bintray.com/trust/wallet-core/com.trustwallet.wallet-core/2.4.1

@jayateertha043
Copy link

Hey,
I was also looking for the same integration ,if you managed to integrate trust wallet into flutter kindly let me know

Thanks and regards
Jayateertha G

@jayateertha043
Copy link

Can't we just put the aar files into android/lib/ folder and interact with them using method channel ?

@hhstore
Copy link
Author

hhstore commented Dec 29, 2020

@hewigovens

  • It's not going well.
  • I encountered some native-related problems, which I can't solve at the moment.
  • Due to time constraints, I am temporarily using the dart native library instead.
  • However, I will still consider replacing it with trustwallet-core.
  • I would still try the FFI or channel method to bind the trustwallet-core.

Follow up:

  • The latest developments will be synchronized in the following 2 projects.

use FFI:

use Platform Channels:

@hhstore
Copy link
Author

hhstore commented Dec 29, 2020

@jayateertha043

  • Using the channel method is a good choice.
  • To use the channel method, you need to write Android/iOS native codes, but I'm not familiar with native.
  • If you are familiar with native coding, you can try it.

@trustwallet trustwallet locked and limited conversation to collaborators Jan 27, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request priority:low
Projects
None yet
Development

No branches or pull requests

3 participants