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.
Will get this exception if I change the volume in the isolate mode.
E/MethodChannel#volume( 7076): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Activity.setVolumeControlStream(int)' on a null object reference
E/MethodChannel#volume( 7076): at com.example.volume.VolumePlugin.controlVolume(VolumePlugin.java:97)
E/MethodChannel#volume( 7076): at com.example.volume.VolumePlugin.onMethodCall(VolumePlugin.java:80)
E/MethodChannel#volume( 7076): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#volume( 7076): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84)
E/MethodChannel#volume( 7076): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865)
E/MethodChannel#volume( 7076): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#volume( 7076): at android.os.MessageQueue.next(MessageQueue.java:332)
E/MethodChannel#volume( 7076): at android.os.Looper.loop(Looper.java:168)
E/MethodChannel#volume( 7076): at android.app.ActivityThread.main(ActivityThread.java:6878)
E/MethodChannel#volume( 7076): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#volume( 7076): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
E/MethodChannel#volume( 7076): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
Will get this exception if I change the volume in the isolate mode.