Skip to content

johnny-vu/flutter_lamp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

Lamp plugin for flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 32.5%
  • Objective-C 26.9%
  • Java 25.1%
  • Ruby 15.5%