pauldemarco / flutter_blue

Bluetooth plugin for Flutter
BSD 3-Clause "New" or "Revised" License
2.36k stars 1.23k forks source link

[SUGGESTION] remove the use of proto #528

Open ramsestom opened 4 years ago

ramsestom commented 4 years ago

I recently forked this lib as I wanted to modify it to add the possibility to advertise with a device (= act as a beacon) but I must say that the fact that this lib use proto message to exchange messages between flutter and the native platforms not only makes modifications heavier and more complicated but is also useless, if not negative, in term of performances. Actually messages that can be send and received are necessarily short messages (because BLE is not meant to send large data) so it does not really make sense to transform them into proto messages back and forth rather than transmitting them as simple dart object structures (lists and/or maps of primitives) between flutter and the native platform. Furthermore it adds a dependency to the lib and increase its weight unecessarily. So, when you have some time, I higly suggest you to get rid of all the proto stuff in this lib. It would make it lighter, clearer and easier to modify by the community.

pauldemarco commented 4 years ago

Thanks for the suggestion.

Although protos do have efficient serialization/deserialization, the real benefit in this plugin is it’s use as an IDL, or contract, between platforms.

Flutter official may be working on a proprietary IDL solution for federated plugins, so I’m keeping an eye on a replacement.