DeviceHardware class

Device Hardware Module for controlling physical hardware and system settings.

Constructors

DeviceHardware(MethodChannel _channel)

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

getBrightness() → Future<double>
Gets the current screen brightness (0.0 to 1.0).
getVolume() → Future<double>
Gets the current media volume (0.0 to 1.0).
mute() → Future<void>
Mutes the media volume.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setBrightness(double brightness) → Future<void>
Sets the screen brightness (0.0 to 1.0). Note: On Android, this usually affects the window attributes.
setFlashlight(bool enabled) → Future<void>
Turns the flashlight (torch) on or off.
setMaxBrightness() → Future<void>
Maximizes brightness (useful for displaying QR codes/Barcodes).
setMaxVolume() → Future<void>
Sets volume to maximum.
setVolume(double volume) → Future<void>
Sets the media volume (0.0 to 1.0).
toggleFlashlight(bool currentKnownState) → Future<void>
Toggles the flashlight. Note: This is a blind toggle based on presumed state if not tracked natively. For robust usage, stick to setFlashlight(true/false) with your own state management.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited