Audio_service: Null safety

Created on 19 Nov 2020  路  11Comments  路  Source: ryanheise/audio_service

Is your feature request related to a problem? Please describe.
As Flutter now supports Dart's null safety technical preview, packages should start to support it.

Describe the solution you'd like
A null_safety branch can be made, like what other packages are doing.

Describe alternatives you've considered
The plugin can be used in null-safe projects, but not with the compiler's "sound" null safety functionality.

Additional context
It may be more practical to wait until all dependencies have null-safe options.

1 backlog enhancement

Most helpful comment

I've just published a stable preview of the null-safe version of just_audio, and previously published the same for flutter_isolate. All dependencies now have stable preview releases for null safety except for flutter_cache_manager. As soon as that turns stable, I'll release a stable preview of null-safe audio_service (subject to any reviews/feedback I may receive from now until then.)

All 11 comments

Yeah, I've been waiting for the right time. I'd expect rxdart and flutter_cache_manager to get null safety support soon enough. For flutter_isolate, there is a chance I'll be able to remove that dependency. If not, it shouldn't be too hard to fix up flutter_isolate.

One step closer with the migration of just_audio. flutter_tts has a PR that is basically ready. flutter_cache_manager is now unblocked now that http is migrated, so that should come eventually.

Probably a good idea for me to get the one-isolate branch ready in time.

The original plan was to make the one-isolate branch coincide with the null safety release, but I think it still needs more time in testing for me to be completely confident about releasing it, so my new plan is to make 0.17.0 a nullsafe version of the current master branch, and then 0.18.0 will be the one-isolate release.

I have therefore just migrated flutter_isolate to null safety. All other dependencies have null safety pull requests in progress so I'll make a nullsafe version of audio_service as soon as those dependencies are ready.

I've just migrated audio_service to null safety (see #602 ). Feel free to review (mainly by looking at the nullability of the public-facing type signatures), and since this is a breaking change, now is also a good time to suggest any other breaking API changes that make sense. For now, I have changed the type of artUri from String to Uri.

Since flutter_tts was not migrated to null safety at this time, I have temporarily removed it from the example.

I've just published a stable preview of the null-safe version of just_audio, and previously published the same for flutter_isolate. All dependencies now have stable preview releases for null safety except for flutter_cache_manager. As soon as that turns stable, I'll release a stable preview of null-safe audio_service (subject to any reviews/feedback I may receive from now until then.)

flutter_cache_manager has a bug fix release (still a prerelease) which helps audio_service to run correctly on web, so I have now published audio_service 0.17.0-nullsafety.0.

flutter_tts now has a stable null safety release - still waiting on flutter_cache_manager to go stable.

I've just added flutter_tts back into the example on git (nnbd branch). Would anyone like to test whether the TTS example works on iOS including notifications and control center? I have had issues in the past where flutter_tts didn't interact well with the control center, so hopefully this still works.

flutter_tts now has a stable null safety release - still waiting on flutter_cache_manager to go stable.

flutter_cache_manager 3.0.0 has been released today with null safety support on stable

Thanks @carloshs94 ! I have just upgraded and release audio_service 0.17.0 (Null safety).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suragch picture suragch  路  4Comments

hpuriamanesh picture hpuriamanesh  路  7Comments

Okladnoj picture Okladnoj  路  6Comments

ryanheise picture ryanheise  路  6Comments

MohamedAbdallah-14 picture MohamedAbdallah-14  路  7Comments