lamp 0.0.6 copy "lamp: ^0.0.6" to clipboard
lamp: ^0.0.6 copied to clipboard

A Flutter plugin to access the device's lamp/torch on Android and iOS.

Lamp #

pub package A Flutter plugin to access the device's lamp/torch on Android and iOS.

Usage #

To use this plugin, add lamp as a dependency in your pubspec.yaml file.

For android, add the following to your manifest

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.flash" />

Example #

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

// Turn the lamp on:
Lamp.turnOn();

// Turn the lamp off:
Lamp.turnOff();

// Turn the lamp with a specific intensity (only affects iOS as of now):
Lamp.turnOn(intensity: 0.4);

// Check if the device has a lamp:
bool hasLamp = await Lamp.hasLamp;

11
likes
40
pub points
64%
popularity

Publisher

unverified uploader

A Flutter plugin to access the device's lamp/torch on Android and iOS.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on lamp