https://github.com/bynicodevelop/flutter_mobile_camera
https://github.com/bynicodevelop/flutter_mobile_camera
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bynicodevelop/flutter_mobile_camera
- Owner: bynicodevelop
- License: other
- Created: 2020-12-13T16:47:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-02T16:13:18.000Z (over 5 years ago)
- Last Synced: 2024-05-28T23:38:26.445Z (about 2 years ago)
- Language: Dart
- Size: 86.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter Mobile Camera
Add camera in your project.
## Getting Started
iOS
Add two rows to the ios/Runner/Info.plist:
one with the key Privacy - Camera Usage Description and a usage description.
and one with the key Privacy - Microphone Usage Description and a usage description.
Or in text format add the key:
```
NSCameraUsageDescription
Can I use the camera please?
NSMicrophoneUsageDescription
Can I use the mic please?
```
Android
Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.
```
minSdkVersion 21
```
## Example
```
import 'package:flutter/material.dart';
import 'package:flutter_mobile_camera/camera.dart';
import 'package:flutter_mobile_camera/CameraBuilder.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: CameraBuilder(
child: Camera(
onBack: () => print('Back navigator'),
onSend: (imagePath) => print(imagePath),
onTakePhoto: (imagePath) => print(imagePath),
),
),
);
}
}
```