{"id":13684773,"url":"https://github.com/Vasseurr/CustomCameraPreview","last_synced_at":"2025-05-01T00:32:55.127Z","repository":{"id":167969295,"uuid":"463179723","full_name":"Vasseurr/CustomCameraPreview","owner":"Vasseurr","description":"Taking many pictures and photos list in the same page","archived":false,"fork":false,"pushed_at":"2022-02-24T17:14:52.000Z","size":274,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-12T06:33:52.566Z","etag":null,"topics":["flutter","flutter-app","flutter-ui"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vasseurr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-02-24T14:29:52.000Z","updated_at":"2024-05-03T09:17:46.000Z","dependencies_parsed_at":"2024-01-14T16:08:44.860Z","dependency_job_id":null,"html_url":"https://github.com/Vasseurr/CustomCameraPreview","commit_stats":null,"previous_names":["vasseurr/customcamerapreview"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasseurr%2FCustomCameraPreview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasseurr%2FCustomCameraPreview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasseurr%2FCustomCameraPreview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vasseurr%2FCustomCameraPreview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vasseurr","download_url":"https://codeload.github.com/Vasseurr/CustomCameraPreview/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251803052,"owners_count":21646329,"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":["flutter","flutter-app","flutter-ui"],"created_at":"2024-08-02T14:00:38.615Z","updated_at":"2025-05-01T00:32:54.837Z","avatar_url":"https://github.com/Vasseurr.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# Custom Camera Preview\nA component has developed with Flutter\n\n## Purpose\n\nInstead of taking photos of a product and taking them one by one when users need to upload anywhere, they can use custom camera preview to take their photos on the same screen, see them as a list and remove them from the list if they want.\n\n## Instruction\n\n\u003ch4\u003e The Camera Preview as the photo \u003c/h4\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/67058617/155558382-7808ba98-e020-46f7-9215-afbee122960c.png\" height=\"500\"\u003e\n\u003ch4\u003e Users can take photos via camera button and save in photo list as below \u003c/h4\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/67058617/155558406-673e9075-28b7-48f0-a92f-288ef8233b31.png\" height=\"500\"\u003e\n\u003ch4\u003eIf the user would like to delete a photo from the list, the user should use 'delete' button over the image. We deleted dog photo (third photo) from the list (You can compare previous screenshot with photo below)\u003c/h4\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/67058617/155558430-8e5bb4dd-b362-4c94-822e-afdc491c452b.png\" height=\"500\"\u003e\n\n## Camera Implementation\nhttps://pub.dev/packages/camera\n\nYou need import 'package:camera/camera.dart' in the camera preview page. Also, you should initialize your camera controller in initState\n```\n@override\n  void initState() {\n    super.initState();\n    availableCameras().then((availableCameras) {\n      cameras = availableCameras;\n      if (cameras.isNotEmpty) {\n        setState(() {\n          selectedCameraIdx = 0;\n        });\n        _initCameraController(cameras[selectedCameraIdx]).then((void v) {});\n      } else {\n        print(\"No camera available\");\n      }\n    }).catchError((err) {\n      print('Error: $err.code\\nError Message: $err.message');\n    });\n  }\n```\n\n## Usage\n\nIf the camera controller is null or uninitialized, return a loading indicator. If not, return custom camera preview with parameters that you must given a empty list with the type of File and a camera controller\n```\nif (controller == null || !controller!.value.isInitialized) {\n   return const Center(\n     child: CircularProgressIndicator(\n       color: Colors.red,\n     ));\n   }\n   return CustomCameraPreview(\n     imageFiles: _homeController.imageFiles,\n     cameraController: controller!,\n);\n```\n\n## Demo\n\nhttps://user-images.githubusercontent.com/67058617/155554501-dcaac7cb-1797-4648-a571-57206bb131bb.mp4\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVasseurr%2FCustomCameraPreview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVasseurr%2FCustomCameraPreview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVasseurr%2FCustomCameraPreview/lists"}