dotintent / FlutterBleLib

Bluetooth Low Energy library for Flutter with support for simulating peripherals
Apache License 2.0
531 stars 195 forks source link

Null-Safety migration #556

Closed RTrackerDev closed 3 years ago

RTrackerDev commented 3 years ago

Do you plan migrate to null-safety? Next Dart(2.12) will be with stable and by default null-safety.

mikolak commented 3 years ago

Plan? Yes. When? I don't know. 🙂 Do you if that feature is backwards compatible?

Link for future reference: https://dart.dev/null-safety/migration-guide

jdar commented 3 years ago

While there's no need a formal roadmap... it would be useful to know the "bus factor" is on this project? Is this just one engineer (you) that is maintaining this?

jlubeck commented 3 years ago

Null safety is now on stable branch since yesterday, so it would be nice to have this so we can convert out projects to fully null safety. Thanks!

DevNico commented 3 years ago

Would be great to have a null safe version ASAP!

okocsis commented 3 years ago

Good news everyone: I'm happy to announce that I've issued my very own PR to support Nullsafety.

I'd like you guys to have a look at my nullsafety branch:

586

what are your thoughts? @mikolak (as mentioned in the pr text, please do help me with the unnecessary and or still broken tests)

thanks!

mikolak commented 3 years ago

While there's no need a formal roadmap... it would be useful to know the "bus factor" is on this project? Is this just one engineer (you) that is maintaining this?

Temporarily I'm the only one on this. Had a bumpy transition and just today I've setup my machine to be able to do anything in the library. I'll try to address some of the issues next week. There are talks with company willing to take over, but I don't know what's the state of things.

Good news everyone: I'm happy to announce that I've issued my very own PR to support Nullsafety.

I'd like you guys to have a look at my nullsafety branch:

586

what are your thoughts? @mikolak (as mentioned in the pr text, please do help me with the unnecessary and or still broken tests)

thanks!

I'll take a look at this next week.

okocsis commented 3 years ago

I'll take a look at this next week.

@mikolak I've managed to fix the broken tests too. (broken due to new nullsafe mockito API) I think it should be fine now! Thanks for reviewing mate!

@jlubeck @DevNico @jdar Could you guys also have look at my branch and perhaps test if it behaves "well enough"? Cheers, Oliver

mikolak commented 3 years ago

FYI there's a release blocker (#591). As soon as I sort it out, I'll release 2.4.0 with null safety and API for checking if native client is allocated.

Jakegillingham5 commented 3 years ago

FYI there's a release blocker (#591). As soon as I sort it out, I'll release 2.4.0 with null safety and API for checking if native client is allocated.

Is this far away from a release, just wanting an update? Planning to migrate my application to null safety but currently blocked by this at the moment.

okocsis commented 3 years ago

migrate my application to null safety but currently blocked by this at the moment.

@Jakegillingham5 You can still migrate your code to a so-called "unsound null safety". I mean I'm using a null safe version of FlutterBleLib maintaining it on my own fork https://github.com/privatdoktor/FlutterBleLib/tree/privatdoktor and even still my null safe migration isn't sound since there are still other dependencies not conforming to null safety. Perhaps time will fix these too. I've also changed a couple of other features that needed fixing and enhancements, mostly on iOS side. I've more or less given up on waiting for Polidea for mering in my work. I might even rerelease the library to the public when it reaches a stable state.

Jakegillingham5 commented 3 years ago

@okocsis Awesome thanks so much for this, I actually made the call last week to just use your commit '1beac74' and bring my project up to date ['unsound null safety' - Flutter 2.2.1]. Will move to your fork now though as most of our users are on iOS so will benefit from any changes in that space, cheers mate.

ifredom commented 2 years ago

image

ozzy1873 commented 2 years ago

@okocsis Hi, I am using your fork too. A big thank you for making a null-safe version! By chance, have you tested it on Android 12? This still seems to be the best Flutter bluetooth plugin available. It makes me nervous that my project relies on a plugin that is no longer maintained, so it would be nice to know if you intend to maintain your fork or if you have suggestions for a different plugin.

okocsis commented 2 years ago

@okocsis Hi, I am using your fork too. A big thank you for making a null-safe version! By chance, have you tested it on Android 12? This still seems to be the best Flutter Bluetooth plugin available. It makes me nervous that my project relies on a plugin that is no longer maintained, so it would be nice to know if you intend to maintain your fork or if you have suggestions for a different plugin.

@ozzy1873 I'm happy to hear that my branch works for others too, which branch of mine are you using in particular? In the Privatdoktor fork I'm currently working on the branch named new_native_ios_plugin. This branch is the one we use, but currently only supports iOS and since I changed/broke the flutter side API the android side needs the same work now in order to work correctly which is in progress now. I'm also thinking of publishing my work under a new name and flutter plugin, since it will no longer share any codebase with this original one. It will be easily portable from FlutterBleLib tho since the changes in the front-facing flutter API will be minimal.

Looking forward to early bird testers on both iOS (now stable) and android (under development). And any feedback and PR-s will be welcome too.

Best, Oliver

ozzy1873 commented 2 years ago

Hi Oliver, thanks for the update! I am using the Privatdoktor fork. If the flutter API has only minimal changes, I would be happy to help test once the Android side is ready. John