-
Notifications
You must be signed in to change notification settings - Fork 483
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
[Feature]: Web Bluetooth Support #769
Comments
feel free to open a PR! |
Just some thoughts. To keep all the platform code similar, we should simulate the API of a platform channel, even though we don't actually need one. in _invokeMethod
in _initFlutterBluePlus
|
I've started on web support: master...feature/web-bluetooth-support I implemented |
Hi @chipweinberger, thank you for your work on this package! I hope you don't mind, I have implemented the web platform, based on your initial branch. What is the recommended approach for testing the web implementation? |
thats awesome. No recommended approach. Just try to test everything :) |
your code looks good. I think stopScan should be a no-op, not unsupported. also, please update the readme. etc. |
Thank you for your feedback, I have refactored |
@tnc1997 recently created a PR for Web: #964 However, FBP plans to remain Android/iOS/Mac only for the foreseeable future. If you'd like to add web support, please do it via wrapper (example: https://pub.dev/packages/flutter_blue_plus_windows). I'll keep this issue open until someone creates a wrapper for Web. |
An in development fork of Flutter Blue Plus that supports web using a platform interface is available here. Please note that this unofficial fork is not endorsed by Chip Weinberger and is supported on a best efforts basis. I would like to thank Chip Weinberger for their ongoing work on the existing Android/iOS/macOS package. |
Hello @chipweinberger . Thank you for your work on this plugin. Do you have plans to add platform_interface to your plugin? If you want to remain Anroid/iOS/Mac support , no problems. Just add platform interface, please, as it did our friend @tnc1997 . |
@yaing11 , this repo will never support other platforms or a platform interface. It's just not a good use of my time. Sorry. But I encourage you to create & maintain your own You could even create your own |
Ohhh, @chipweinberger. It's a pity, but you won't spent your time. Let me create PR where I will add platform interface to your plugin and you still continue support ONLY 3 platform as you want. It's modern solution and Google recommends to use platform interface in a plugin develoment. |
thanks, but please create your own I will not add a platform interface to this package. Why? I don't want to maintain it as each platform evolves. |
I've already created but it needs to sync with your repo each time. It's not good. My app supports 6 platforms - android,ios, macos, linux, web, windows, |
@chipweinberger You will maintain only your platforms , but with platform_interface. There is no need to maintain platform_interface because it's created only once.... |
That's not really true. Every year the BLE APIs change slightly, and the platform interface needs to change too. For example, iOS 17 added Which is why I recommend you create your own package. |
@chipweinberger as I wrote my app supports 6 platforms, but for android, ios, macos i want to use your solution because it's very good and if we have platform interface we will have more clean solution. |
I understand. I recommend you create a new package If it becomes popular, everyone can migrate to it. |
@tnc1997 many thanks that you joined to our discussion. Do you agree with what @chipweinberger wrote ? |
You are welcome to use this unofficial fork of Flutter Blue Plus that supports additional platforms using a platform interface and is supported on a best efforts basis. |
@tnc1997 , wow! your fork has come a long way! You really ought to give it a proper new name! |
In theory the platform interface wouldn't need to change if a platform specific implementation changes, however it would need to change if an interface method changes (for example if fields are added/removed to/from a request model). |
@tnc1997 , if you give it a new name (so it's easier to distinguish), I'll link to it in the FBP readme. |
Thank you very much for your kind words, it currently uses the same name so that developers only need to update the |
Fair point. What about just a more distinguished repo & package name? You could still use FlutterBluePlus as your api entrypoint for users. flutter_blue_plus_universal |
That would still require developers to update all the import statements throughout their application with the different package name (flutter_blue_plus_universal). One of the aims of the fork is that developers can use it as a drop-in replacement whilst making the minimum amount of changes to their application as possible. |
On second thought, I think i'll link to it regardless. But I strongly encourage a proper new name. Don't you want to submit it to |
Ultimately it would be great one day in the future to merge the fork into this repository and obsolete the fork but I very much appreciate that you would prefer to keep them separate for the time being. |
@chipweinberger Do you think it's a clean solution??? Obviously it's bad solution and any plugin without platform interface is not scalable. My app supports 6 platforms. If your plugin had platform interface i would add only 1 line to the code of my app. This You have to agree with me it's very clean and scalable solution. But now i have to add import statement for each new platform. It's not a good solution. Please, take a look at most popular plugins in flutter https://pub.dev/packages?q=sdk%3Aflutter&sort=popularity. Each of them has platform interface. For, example, shared_preferences or url_launcher All of these plugins are at the top with for more than 1M downloads. |
FlutterBluePlus Version
all
Flutter Version
all
What OS?
All
OS Version
Supported Chrome
Bluetooth Module
any
What is your feature request?
With Chrome ( behind flag ) supporting Web Bluetooth standard, This can be a great addition for Flutter Web Development.
If anyone is interested please let me know
Logs
Chrome Web BLE support: https://developer.chrome.com/docs/capabilities/bluetooth?hl=en Web Bluetooth W3C Spec: https://webbluetoothcg.github.io/web-bluetooth/
The text was updated successfully, but these errors were encountered: