flutter_camera 1.0.0 flutter_camera: ^1.0.0 copied to clipboard
A Flutter plugin for iOS and Android allowing access to the device cameras and recording of videos.
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_camera/flutter_camera.dart';
class CameraPage extends StatefulWidget {
const CameraPage({Key? key}) : super(key: key);
@override
_CameraPageState createState() => _CameraPageState();
}
class _CameraPageState extends State<CameraPage> {
@override
Widget build(BuildContext context) {
return FlutterCamera(
color: Colors.amber,
onImageCaptured: (value) {
final path = value.path;
print("::::::::::::::::::::::::::::::::: $path");
if (path.contains('.jpg')) {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Image.file(File(path)),
);
});
}
},
onVideoRecorded: (value) {
final path = value.path;
print('::::::::::::::::::::::::;; dkdkkd $path');
},
);
// return Container();
}
}