{"id":17728330,"url":"https://github.com/moeiscool/flutter-camera-plugin","last_synced_at":"2025-03-31T16:37:28.534Z","repository":{"id":99294149,"uuid":"223081580","full_name":"moeiscool/flutter-camera-plugin","owner":"moeiscool","description":null,"archived":false,"fork":false,"pushed_at":"2019-11-21T04:41:49.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T16:55:35.754Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moeiscool.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-21T03:37:58.000Z","updated_at":"2019-11-21T04:41:51.000Z","dependencies_parsed_at":"2023-07-18T21:31:29.380Z","dependency_job_id":null,"html_url":"https://github.com/moeiscool/flutter-camera-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeiscool%2Fflutter-camera-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeiscool%2Fflutter-camera-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeiscool%2Fflutter-camera-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moeiscool%2Fflutter-camera-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moeiscool","download_url":"https://codeload.github.com/moeiscool/flutter-camera-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246499136,"owners_count":20787452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-25T19:22:51.134Z","updated_at":"2025-03-31T16:37:28.513Z","avatar_url":"https://github.com/moeiscool.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Camera Plugin\n\n[![pub package](https://img.shields.io/pub/v/camera.svg)](https://pub.dartlang.org/packages/camera)\n\nA Flutter plugin for iOS and Android allowing access to the device cameras.\n\n*Note*: This plugin is still under development, and some APIs might not be available yet. We are working on a refactor which can be followed here: [issue](https://github.com/flutter/flutter/issues/31225)\n\n## Features:\n\n* Display live camera preview in a widget.\n* Snapshots can be captured and saved to a file.\n* Record video.\n* Add access to the image stream from Dart.\n\n## Installation\n\nFirst, add `camera` as a [dependency in your pubspec.yaml file](https://flutter.io/using-packages/).\n\n### iOS\n\nAdd two rows to the `ios/Runner/Info.plist`:\n\n* one with the key `Privacy - Camera Usage Description` and a usage description.\n* and one with the key `Privacy - Microphone Usage Description` and a usage description.\n\nOr in text format add the key:\n\n```xml\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eCan I use the camera please?\u003c/string\u003e\n\u003ckey\u003eNSMicrophoneUsageDescription\u003c/key\u003e\n\u003cstring\u003eCan I use the mic please?\u003c/string\u003e\n```\n\n### Android\n\nChange the minimum Android sdk version to 21 (or higher) in your `android/app/build.gradle` file.\n\n```\nminSdkVersion 21\n```\n\n### Example\n\nHere is a small example flutter app displaying a full screen camera preview.\n\n```dart\nimport 'dart:async';\nimport 'package:flutter/material.dart';\nimport 'package:camera/camera.dart';\n\nList\u003cCameraDescription\u003e cameras;\n\nFuture\u003cvoid\u003e main() async {\n  cameras = await availableCameras();\n  runApp(CameraApp());\n}\n\nclass CameraApp extends StatefulWidget {\n  @override\n  _CameraAppState createState() =\u003e _CameraAppState();\n}\n\nclass _CameraAppState extends State\u003cCameraApp\u003e {\n  CameraController controller;\n\n  @override\n  void initState() {\n    super.initState();\n    controller = CameraController(cameras[0], ResolutionPreset.medium);\n    controller.initialize().then((_) {\n      if (!mounted) {\n        return;\n      }\n      setState(() {});\n    });\n  }\n\n  @override\n  void dispose() {\n    controller?.dispose();\n    super.dispose();\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    if (!controller.value.isInitialized) {\n      return Container();\n    }\n    return AspectRatio(\n        aspectRatio:\n        controller.value.aspectRatio,\n        child: CameraPreview(controller));\n  }\n}\n```\n\nFor a more elaborate usage example see [here](https://github.com/flutter/plugins/tree/master/packages/camera/example).\n\n*Note*: This plugin is still under development, and some APIs might not be available yet.\n[Feedback welcome](https://github.com/flutter/flutter/issues) and\n[Pull Requests](https://github.com/flutter/plugins/pulls) are most welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoeiscool%2Fflutter-camera-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoeiscool%2Fflutter-camera-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoeiscool%2Fflutter-camera-plugin/lists"}