Aman-Malhotra / Volume_Flutter

Now you can change android volumes in Flutter. You can change MEDIA volume, NOTIFICATION volume, RING Volume, VOICE CALL Volume, ALARM Volume and SYSTEM Volume. This is exclusively for android right now because I don't have max to do the IOS coding and I don't have experience in IOS coding as well. Pull requests for IOS Implementation are welcome.
MIT License
23 stars 31 forks source link

Migrate to null-safety #9

Open Zeswen opened 3 years ago

Zeswen commented 3 years ago

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.

pcmushthaq commented 3 years ago

Is there any progress on this?

ashishbeck commented 3 years ago

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

itanium21 commented 2 years ago

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?

ashishbeck commented 2 years ago

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
Pana-g commented 2 years ago

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