volume_regulator 0.0.2 copy "volume_regulator: ^0.0.2" to clipboard
volume_regulator: ^0.0.2 copied to clipboard

outdated

A Flutter plugin to adjust device volume from 0% to 100%. Compatible with Android 6.0+ and iOS 10.0+.

Volume Regulator #

A Flutter plugin to adjust device volume from 0% to 100%. Compatible with Android 6.0+ and iOS 10.0+.

flutter platform pub package License: MIT

Installation #

To use this package, add volume_regulator as a dependency in your pubspec.yaml file.

dependencies:
  volume_regulator: ^0.0.1

iOS #

To hide the volume HUD edit your AppDelegate.swift and add self.window?.insertSubview(MPVolumeView(), at: 0)

import UIKit
import Flutter
import MediaPlayer

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        self.window?.insertSubview(MPVolumeView(), at: 0)
        GeneratedPluginRegistrant.register(with: self)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
}

Usage #

// Import package
import 'package:volume_regulator/volume_regulator.dart';

// Set the new volume, between 0-100.
VolumeRegulator.setVolume(50);

// Get the current volume.
VolumeRegulator.getVolume().then((value) {
  print(value);
});

Volume Event #

This event is fired when the volume has changed.

VolumeRegulator.volumeStream.listen((value) {
  print(value);
});

Contributing #

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

9
likes
0
points
163
downloads

Publisher

verified publisheryar.net

Weekly Downloads

A Flutter plugin to adjust device volume from 0% to 100%. Compatible with Android 6.0+ and iOS 10.0+.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on volume_regulator