flutter_lantern 0.0.1 copy "flutter_lantern: ^0.0.1" to clipboard
flutter_lantern: ^0.0.1 copied to clipboard

A new flutter plugin project.

Lantern #

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

Usage #

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

It works on Android Pie !!

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.flash" />

and change the minSDK in the app build.graddle

minSdkVersion 21

Example #

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

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

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

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

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

2
likes
20
pub points
1%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_lantern