plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Request]: Migrate to FFI

Open dickermoshe opened this issue 8 months ago • 3 comments

Plugin

battery_plus

Use case

The packages you guys have been maintaining are crucial for the Flutter ecosystem. Method Channels work great, but now that FFI and JNI are maturing, I think it would be a great time to start migrating over to them where possible.

The primary benefits to this are:

  • Synchronous API
  • Improved Performance
  • Vanilla Dart Support

Proposal

I've already migrated path_provider to use FFI (https://pub.dev/packages/path_provider_ffi) and I would love to do that here too. Would you be interested in a PR. I would start with battery_plus first.

dickermoshe avatar Apr 25 '25 16:04 dickermoshe

Sounds like a great idea, so go ahead. I think I saw your tweets recently about path_provider.

cc @miquelbeltran I think you might also be curios about it.

vbuberen avatar Apr 28 '25 13:04 vbuberen

I think that battery_plus is small enough that it could be a good start. I would probably advise publishing a fork first (e.g. battery_plus_ffi or battery_ffi) that is using the battery_plus_platform_interface, and then later incorporate the implementation changes.

miquelbeltran avatar Apr 28 '25 14:04 miquelbeltran

I would probably advise publishing a fork first

I would rather not publishing a package on pub that I do not plan on maintaining.

dickermoshe avatar Apr 28 '25 17:04 dickermoshe