Volume_Flutter icon indicating copy to clipboard operation
Volume_Flutter copied to clipboard

Migrate to null-safety

Open Zeswen opened this issue 3 years ago • 5 comments

Migrate existing code to null-safety.

Full Description Since last week, Flutter 2.0 hit stable branch. With 2.0 we've received Dart 2.12 with new sound null safety mechanism. Current volume package doesn't support null-safety yet therefore migration is a must.

Example Code Migration will touch most of the code. Key objectives here is to utilise dart migrate so all of the heavy lifting is done. And after that, run the build and fix places, that were fixed incorrectly by the tool.

Platforms Migration will touch all of the platforms.

Research Resources null-safety is unavoidable thus sooner or later it must be done. https://dart.dev/null-safety

Additional This will be a heavy migration therefore careful code review is a must from one or more developers, after everything is done.

Zeswen avatar Mar 11 '21 12:03 Zeswen

Is there any progress on this?

pcmushthaq avatar May 04 '21 06:05 pcmushthaq

The developer seems to have abandoned the project. There are better alternatives that also support iOS and can hide the volume UI. I would recommend using this one - https://pub.dev/packages/perfect_volume_control or https://pub.dev/packages/volume_controller

ashishbeck avatar Jun 12 '21 09:06 ashishbeck

I would recommend using this one - https://pub.dev/packages/perfect_volume_control or https://pub.dev/packages/volume_controller

They both can control only device volume, Volume_Flutter could do a lot more:

AudioManager.STREAM_VOICE_CALL -> Controll IN CALL Volume AudioManager.STREAM_SYSTEM -> Controll SYSTEM Volume AudioManager.STREAM_RING -> Controll RINGER Volume AudioManager.STREAM_MUSIC -> Controll MEDIA Volume AudioManager.STREAM_ALARM -> Controll ALARM Volume AudioManager.STREAM_NOTIFICATION -> Controll NOTIFICATION Volume

Any alternatives for controlling STREAM_SYSTEM, STREAM_ALARM?

itanium21 avatar Sep 29 '21 18:09 itanium21

I would recommend using this one - https://pub.dev/packages/perfect_volume_control or https://pub.dev/packages/volume_controller

They both can control only device volume, Volume_Flutter could do a lot more:

AudioManager.STREAM_VOICE_CALL -> Controll IN CALL Volume AudioManager.STREAM_SYSTEM -> Controll SYSTEM Volume AudioManager.STREAM_RING -> Controll RINGER Volume AudioManager.STREAM_MUSIC -> Controll MEDIA Volume AudioManager.STREAM_ALARM -> Controll ALARM Volume AudioManager.STREAM_NOTIFICATION -> Controll NOTIFICATION Volume

Any alternatives for controlling STREAM_SYSTEM, STREAM_ALARM?

Okay, so I went ahead and tried to make a null-safe version of this package. Remember that iOS is not yet supported and I am not planning to maintain it. Give it a try:

  volume:
    git:
      url: https://github.com/ashishbeck/Volume_Flutter

ashishbeck avatar Oct 01 '21 05:10 ashishbeck

You can also try this one I created https://pub.dev/packages/real_volume that works for both Android and iOS.

Pana-g avatar Feb 17 '22 14:02 Pana-g