{"action":"created","comment":{"url":"https://api.github.com/repos/flutter/plugins/pulls/comments/180192612","pull_request_review_id":110571972,"id":180192612,"diff_hunk":"@@ -37,81 +42,144 @@ class _CameraExampleHomeState extends State<CameraExampleHome> {\n \n   @override\n   Widget build(BuildContext context) {\n-    final List<Widget> headerChildren = <Widget>[];\n-\n+    final List<Widget> controlsChildren = <Widget>[];\n     final List<Widget> cameraList = <Widget>[];\n \n     if (cameras.isEmpty) {\n-      cameraList.add(const Text('No cameras found'));\n+      cameraList.add(const Text('No camera found'));\n     } else {\n       for (CameraDescription cameraDescription in cameras) {\n         cameraList.add(\n           new SizedBox(\n             width: 90.0,\n             child: new RadioListTile<CameraDescription>(\n-              title: new Icon(cameraLensIcon(cameraDescription.lensDirection)),\n-              groupValue: controller?.description,\n-              value: cameraDescription,\n-              onChanged: (CameraDescription newValue) async {\n-                final CameraController tempController = controller;\n-                controller = null;\n-                await tempController?.dispose();\n-                controller =\n-                    new CameraController(newValue, ResolutionPreset.high);\n-                await controller.initialize();\n-                setState(() {});\n-              },\n-            ),\n+                title: new Icon(\n+                    getCameraLensIcon(cameraDescription.lensDirection)),\n+                groupValue: controller?.description,\n+                value: cameraDescription,\n+                onChanged: (CameraDescription newValue) async =>\n+                    onNewCameraSelected(newValue)),\n           ),\n         );\n       }\n     }\n \n-    headerChildren.add(new Column(children: cameraList));\n-    if (controller != null) {\n-      headerChildren.add(playPauseButton());\n-    }\n+    // Add the cameras to the main controls widget.\n+    controlsChildren.add(new Row(children: cameraList));\n+\n     if (imagePath != null) {\n-      headerChildren.add(imageWidget());\n+      controlsChildren.add(imageWidget());\n     }\n \n-    final List<Widget> columnChildren = <Widget>[];\n-    columnChildren.add(new Row(children: headerChildren));\n+    // Initialize the preview window\n+    final List<Widget> previewChildren = <Widget>[];\n+\n+    // Depending on controller state display a message or the camera preview.\n     if (controller == null || !controller.value.initialized) {\n-      columnChildren.add(const Text('Tap a camera'));\n+      previewChildren.add(new Text(\n+        'Tap a camera',\n+        style: new TextStyle(\n+          color: Colors.white,\n+          fontSize: 24.0,\n+          fontWeight: FontWeight.w900,\n+        ),\n+      ));\n     } else if (controller.value.hasError) {\n-      columnChildren.add(\n+      previewChildren.add(\n         new Text('Camera error ${controller.value.errorDescription}'),\n       );\n     } else {\n-      columnChildren.add(\n-        new Expanded(\n-          child: new Padding(\n-            padding: const EdgeInsets.all(5.0),\n-            child: new Center(\n-              child: new AspectRatio(\n-                aspectRatio: controller.value.aspectRatio,\n-                child: new CameraPreview(controller),\n-              ),\n-            ),\n+      previewChildren.add(\n+        new Container(\n+          // Handle the preview depending on the aspect ratio of the camera view.\n+          child: new AspectRatio(\n+            aspectRatio: controller.value.aspectRatio,\n+            child: new CameraPreview(controller),\n           ),\n+          height: (MediaQuery.of(context).size.height - 230.0),","path":"packages/camera/example/lib/main.dart","position":131,"original_position":131,"commit_id":"97334a994214244ec22657698d22b28038919fa7","original_commit_id":"97334a994214244ec22657698d22b28038919fa7","user":{"login":"nisdis","id":1233264,"avatar_url":"https://avatars0.githubusercontent.com/u/1233264?v=4","gravatar_id":"","url":"https://api.github.com/users/nisdis","html_url":"https://github.com/nisdis","followers_url":"https://api.github.com/users/nisdis/followers","following_url":"https://api.github.com/users/nisdis/following{/other_user}","gists_url":"https://api.github.com/users/nisdis/gists{/gist_id}","starred_url":"https://api.github.com/users/nisdis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nisdis/subscriptions","organizations_url":"https://api.github.com/users/nisdis/orgs","repos_url":"https://api.github.com/users/nisdis/repos","events_url":"https://api.github.com/users/nisdis/events{/privacy}","received_events_url":"https://api.github.com/users/nisdis/received_events","type":"User","site_admin":false},"body":"The image that is captured is previewed as a thumbnail which varies in dimensions depending on the device camera resolution.  The widget `buildImagePreviewWidget` creates this preview 'Expanded' view. 230.0 is the optimal size keeping the Camera Preview to a maximum without overlap of the thumbnail. There is scope for improvement here with the layout. \r\n\r\nWe could possibly use `stack` but at the moment this keeps it simple.","created_at":"2018-04-09T18:45:27Z","updated_at":"2018-04-09T18:45:27Z","html_url":"https://github.com/flutter/plugins/pull/458#discussion_r180192612","pull_request_url":"https://api.github.com/repos/flutter/plugins/pulls/458","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/flutter/plugins/pulls/comments/180192612"},"html":{"href":"https://github.com/flutter/plugins/pull/458#discussion_r180192612"},"pull_request":{"href":"https://api.github.com/repos/flutter/plugins/pulls/458"}},"in_reply_to_id":180084830},"pull_request":{"url":"https://api.github.com/repos/flutter/plugins/pulls/458","id":179066761,"html_url":"https://github.com/flutter/plugins/pull/458","diff_url":"https://github.com/flutter/plugins/pull/458.diff","patch_url":"https://github.com/flutter/plugins/pull/458.patch","issue_url":"https://api.github.com/repos/flutter/plugins/issues/458","number":458,"state":"open","locked":false,"title":"Camera plugin first working version (IOS and Android).","user":{"login":"quentinleguennec","id":15834229,"avatar_url":"https://avatars1.githubusercontent.com/u/15834229?v=4","gravatar_id":"","url":"https://api.github.com/users/quentinleguennec","html_url":"https://github.com/quentinleguennec","followers_url":"https://api.github.com/users/quentinleguennec/followers","following_url":"https://api.github.com/users/quentinleguennec/following{/other_user}","gists_url":"https://api.github.com/users/quentinleguennec/gists{/gist_id}","starred_url":"https://api.github.com/users/quentinleguennec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quentinleguennec/subscriptions","organizations_url":"https://api.github.com/users/quentinleguennec/orgs","repos_url":"https://api.github.com/users/quentinleguennec/repos","events_url":"https://api.github.com/users/quentinleguennec/events{/privacy}","received_events_url":"https://api.github.com/users/quentinleguennec/received_events","type":"User","site_admin":false},"body":"Ready for review.\r\n","created_at":"2018-04-03T11:17:45Z","updated_at":"2018-04-09T18:45:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71a7902cddcf956745fa924b997bd9469aafb8a7","assignee":{"login":"sigurdm","id":8613953,"avatar_url":"https://avatars1.githubusercontent.com/u/8613953?v=4","gravatar_id":"","url":"https://api.github.com/users/sigurdm","html_url":"https://github.com/sigurdm","followers_url":"https://api.github.com/users/sigurdm/followers","following_url":"https://api.github.com/users/sigurdm/following{/other_user}","gists_url":"https://api.github.com/users/sigurdm/gists{/gist_id}","starred_url":"https://api.github.com/users/sigurdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigurdm/subscriptions","organizations_url":"https://api.github.com/users/sigurdm/orgs","repos_url":"https://api.github.com/users/sigurdm/repos","events_url":"https://api.github.com/users/sigurdm/events{/privacy}","received_events_url":"https://api.github.com/users/sigurdm/received_events","type":"User","site_admin":false},"assignees":[{"login":"sigurdm","id":8613953,"avatar_url":"https://avatars1.githubusercontent.com/u/8613953?v=4","gravatar_id":"","url":"https://api.github.com/users/sigurdm","html_url":"https://github.com/sigurdm","followers_url":"https://api.github.com/users/sigurdm/followers","following_url":"https://api.github.com/users/sigurdm/following{/other_user}","gists_url":"https://api.github.com/users/sigurdm/gists{/gist_id}","starred_url":"https://api.github.com/users/sigurdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigurdm/subscriptions","organizations_url":"https://api.github.com/users/sigurdm/orgs","repos_url":"https://api.github.com/users/sigurdm/repos","events_url":"https://api.github.com/users/sigurdm/events{/privacy}","received_events_url":"https://api.github.com/users/sigurdm/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":616170846,"url":"https://api.github.com/repos/flutter/plugins/labels/cla:%20yes","name":"cla: yes","color":"FFFFFF","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/flutter/plugins/pulls/458/commits","review_comments_url":"https://api.github.com/repos/flutter/plugins/pulls/458/comments","review_comment_url":"https://api.github.com/repos/flutter/plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flutter/plugins/issues/458/comments","statuses_url":"https://api.github.com/repos/flutter/plugins/statuses/97334a994214244ec22657698d22b28038919fa7","head":{"label":"Tengio:master","ref":"master","sha":"97334a994214244ec22657698d22b28038919fa7","user":{"login":"Tengio","id":13369870,"avatar_url":"https://avatars3.githubusercontent.com/u/13369870?v=4","gravatar_id":"","url":"https://api.github.com/users/Tengio","html_url":"https://github.com/Tengio","followers_url":"https://api.github.com/users/Tengio/followers","following_url":"https://api.github.com/users/Tengio/following{/other_user}","gists_url":"https://api.github.com/users/Tengio/gists{/gist_id}","starred_url":"https://api.github.com/users/Tengio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tengio/subscriptions","organizations_url":"https://api.github.com/users/Tengio/orgs","repos_url":"https://api.github.com/users/Tengio/repos","events_url":"https://api.github.com/users/Tengio/events{/privacy}","received_events_url":"https://api.github.com/users/Tengio/received_events","type":"Organization","site_admin":false},"repo":{"id":121255847,"name":"plugins","full_name":"Tengio/plugins","owner":{"login":"Tengio","id":13369870,"avatar_url":"https://avatars3.githubusercontent.com/u/13369870?v=4","gravatar_id":"","url":"https://api.github.com/users/Tengio","html_url":"https://github.com/Tengio","followers_url":"https://api.github.com/users/Tengio/followers","following_url":"https://api.github.com/users/Tengio/following{/other_user}","gists_url":"https://api.github.com/users/Tengio/gists{/gist_id}","starred_url":"https://api.github.com/users/Tengio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tengio/subscriptions","organizations_url":"https://api.github.com/users/Tengio/orgs","repos_url":"https://api.github.com/users/Tengio/repos","events_url":"https://api.github.com/users/Tengio/events{/privacy}","received_events_url":"https://api.github.com/users/Tengio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Tengio/plugins","description":"Plugins for Flutter, including FlutterFire, maintained by the Flutter team","fork":true,"url":"https://api.github.com/repos/Tengio/plugins","forks_url":"https://api.github.com/repos/Tengio/plugins/forks","keys_url":"https://api.github.com/repos/Tengio/plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tengio/plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tengio/plugins/teams","hooks_url":"https://api.github.com/repos/Tengio/plugins/hooks","issue_events_url":"https://api.github.com/repos/Tengio/plugins/issues/events{/number}","events_url":"https://api.github.com/repos/Tengio/plugins/events","assignees_url":"https://api.github.com/repos/Tengio/plugins/assignees{/user}","branches_url":"https://api.github.com/repos/Tengio/plugins/branches{/branch}","tags_url":"https://api.github.com/repos/Tengio/plugins/tags","blobs_url":"https://api.github.com/repos/Tengio/plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tengio/plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tengio/plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tengio/plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tengio/plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/Tengio/plugins/languages","stargazers_url":"https://api.github.com/repos/Tengio/plugins/stargazers","contributors_url":"https://api.github.com/repos/Tengio/plugins/contributors","subscribers_url":"https://api.github.com/repos/Tengio/plugins/subscribers","subscription_url":"https://api.github.com/repos/Tengio/plugins/subscription","commits_url":"https://api.github.com/repos/Tengio/plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tengio/plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tengio/plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tengio/plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tengio/plugins/contents/{+path}","compare_url":"https://api.github.com/repos/Tengio/plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tengio/plugins/merges","archive_url":"https://api.github.com/repos/Tengio/plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tengio/plugins/downloads","issues_url":"https://api.github.com/repos/Tengio/plugins/issues{/number}","pulls_url":"https://api.github.com/repos/Tengio/plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/Tengio/plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/Tengio/plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tengio/plugins/labels{/name}","releases_url":"https://api.github.com/repos/Tengio/plugins/releases{/id}","deployments_url":"https://api.github.com/repos/Tengio/plugins/deployments","created_at":"2018-02-12T14:22:12Z","updated_at":"2018-04-05T10:52:48Z","pushed_at":"2018-04-05T10:52:45Z","git_url":"git://github.com/Tengio/plugins.git","ssh_url":"git@github.com:Tengio/plugins.git","clone_url":"https://github.com/Tengio/plugins.git","svn_url":"https://github.com/Tengio/plugins","homepage":"https://flutter.io/","size":22275,"stargazers_count":2,"watchers_count":2,"language":"Dart","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":2,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"flutter:master","ref":"master","sha":"ee807459f8436b1640060dcbf2e28ccb97d84a8a","user":{"login":"flutter","id":14101776,"avatar_url":"https://avatars3.githubusercontent.com/u/14101776?v=4","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"repo":{"id":88650014,"name":"plugins","full_name":"flutter/plugins","owner":{"login":"flutter","id":14101776,"avatar_url":"https://avatars3.githubusercontent.com/u/14101776?v=4","gravatar_id":"","url":"https://api.github.com/users/flutter","html_url":"https://github.com/flutter","followers_url":"https://api.github.com/users/flutter/followers","following_url":"https://api.github.com/users/flutter/following{/other_user}","gists_url":"https://api.github.com/users/flutter/gists{/gist_id}","starred_url":"https://api.github.com/users/flutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flutter/subscriptions","organizations_url":"https://api.github.com/users/flutter/orgs","repos_url":"https://api.github.com/users/flutter/repos","events_url":"https://api.github.com/users/flutter/events{/privacy}","received_events_url":"https://api.github.com/users/flutter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flutter/plugins","description":"Plugins for Flutter, including FlutterFire, maintained by the Flutter team","fork":false,"url":"https://api.github.com/repos/flutter/plugins","forks_url":"https://api.github.com/repos/flutter/plugins/forks","keys_url":"https://api.github.com/repos/flutter/plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flutter/plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flutter/plugins/teams","hooks_url":"https://api.github.com/repos/flutter/plugins/hooks","issue_events_url":"https://api.github.com/repos/flutter/plugins/issues/events{/number}","events_url":"https://api.github.com/repos/flutter/plugins/events","assignees_url":"https://api.github.com/repos/flutter/plugins/assignees{/user}","branches_url":"https://api.github.com/repos/flutter/plugins/branches{/branch}","tags_url":"https://api.github.com/repos/flutter/plugins/tags","blobs_url":"https://api.github.com/repos/flutter/plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flutter/plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flutter/plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/flutter/plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flutter/plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/flutter/plugins/languages","stargazers_url":"https://api.github.com/repos/flutter/plugins/stargazers","contributors_url":"https://api.github.com/repos/flutter/plugins/contributors","subscribers_url":"https://api.github.com/repos/flutter/plugins/subscribers","subscription_url":"https://api.github.com/repos/flutter/plugins/subscription","commits_url":"https://api.github.com/repos/flutter/plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/flutter/plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/flutter/plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/flutter/plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/flutter/plugins/contents/{+path}","compare_url":"https://api.github.com/repos/flutter/plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flutter/plugins/merges","archive_url":"https://api.github.com/repos/flutter/plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flutter/plugins/downloads","issues_url":"https://api.github.com/repos/flutter/plugins/issues{/number}","pulls_url":"https://api.github.com/repos/flutter/plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/flutter/plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/flutter/plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flutter/plugins/labels{/name}","releases_url":"https://api.github.com/repos/flutter/plugins/releases{/id}","deployments_url":"https://api.github.com/repos/flutter/plugins/deployments","created_at":"2017-04-18T17:02:37Z","updated_at":"2018-04-09T18:00:35Z","pushed_at":"2018-04-09T18:38:19Z","git_url":"git://github.com/flutter/plugins.git","ssh_url":"git@github.com:flutter/plugins.git","clone_url":"https://github.com/flutter/plugins.git","svn_url":"https://github.com/flutter/plugins","homepage":"https://flutter.io/","size":9754,"stargazers_count":605,"watchers_count":605,"language":"Dart","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":252,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":252,"open_issues":15,"watchers":605,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flutter/plugins/pulls/458"},"html":{"href":"https://github.com/flutter/plugins/pull/458"},"issue":{"href":"https://api.github.com/repos/flutter/plugins/issues/458"},"comments":{"href":"https://api.github.com/repos/flutter/plugins/issues/458/comments"},"review_comments":{"href":"https://api.github.com/repos/flutter/plugins/pulls/458/comments"},"review_comment":{"href":"https://api.github.com/repos/flutter/plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flutter/plugins/pulls/458/commits"},"statuses":{"href":"https://api.github.com/repos/flutter/plugins/statuses/97334a994214244ec22657698d22b28038919fa7"}},"author_association":"NONE"}}
{"actor":{"display_login":"nisdis"}}