flutter_mobile_camera 0.0.2+1 copy "flutter_mobile_camera: ^0.0.2+1" to clipboard
flutter_mobile_camera: ^0.0.2+1 copied to clipboard

outdated

This plugin allows you to take front and back photos by integrating the camera into your application.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_mobile_camera/CameraBuilder.dart';
import 'package:flutter_mobile_camera/flutter_mobile_camera.dart';

void main() {
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Builder(
        builder: (context) => Scaffold(
          body: Container(
            child: Center(
              child: IconButton(
                icon: Icon(Icons.camera_alt),
                onPressed: () => Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => CameraView(),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

class CameraView extends StatelessWidget {
  const CameraView({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    print('view');
    // To initialize camera mobile
    return CameraBuilder(
      // Display the camera in the app
      child: Camera(
        // Lets go back !
        onBack: () => print('Back navigator'),
        // When you want to recover the photo to send it to the cloud
        onSend: (imagePath) => print(imagePath),
        // Capture the photo taking event
        onTakePhoto: (imagePath) => print(imagePath),
      ),
    );
  }
}
5
likes
0
pub points
26%
popularity

Publisher

unverified uploader

This plugin allows you to take front and back photos by integrating the camera into your application.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

camera, flutter, flutter_spinkit, path, path_provider, provider

More

Packages that depend on flutter_mobile_camera