camera_features 0.0.2 copy "camera_features: ^0.0.2" to clipboard
camera_features: ^0.0.2 copied to clipboard

A flutter plugin that returns to you the features of the device camera.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:camera_features/camera_features.dart';

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

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

class _MyAppState extends State<MyApp> {
  String _cameraInfo = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  Future<void> initPlatformState() async {
    String cameraInfo;
    try {
      var teste = new List<String>();
      teste.add("FLASH_INFO_AVAILABLE");
      teste.add("LENS_FACING");
      cameraInfo = await CameraFeatures.getCameraFeatures(teste);
    } on PlatformException {
      cameraInfo = 'Failed to get platform version.';
    }

    if (!mounted) return;

    setState(() {
      _cameraInfo = cameraInfo;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ListView(
            children: <Widget>[
              Text(_cameraInfo)
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A flutter plugin that returns to you the features of the device camera.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on camera_features