camera_flash 0.0.3

Flutter Android iOS

Plugin support open flashlight in camera

example/lib/main.dart

import 'package:camera/camera.dart';
import 'package:camera_flash_example/camera.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());


class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomeScreen());
  }
}

class HomeScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: Center(
        child: RaisedButton(
          child: Text("Toggle Flash"),
          onPressed: () async {
            final cameras = await availableCameras();
            Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context) {
              return MessageCameraScreen(camera: cameras.first);
            }));
          },
        ),
      ),
    );
  }
}
0
likes
80
pub points
62%
popularity

Plugin support open flashlight in camera

Homepage

Documentation

API reference

Uploader

nghia.tsy@gmail.com

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on camera_flash