File tree Expand file tree Collapse file tree 6 files changed +34
-7
lines changed
packages/camera/camera_web Expand file tree Collapse file tree 6 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 1+ ## 0.3.2+1
2+
3+ * Updates README to improve example of ` Image ` creation.
4+
15## 0.3.2
26
37* Changes ` availableCameras ` to not ask for the microphone permission.
Original file line number Diff line number Diff line change @@ -80,11 +80,13 @@ URL pointing to a location within the browser (blob) and can be displayed using
8080
8181See the example below:
8282
83+ <? code-excerpt "example/lib/readme_excerpts.dart (ImageFromXFile)"?>
8384``` dart
85+ final Image image;
8486if (kIsWeb) {
85- Image.network(capturedImage.path);
87+ image = Image.network(capturedImage.path);
8688} else {
87- Image.file(File(capturedImage.path));
89+ image = Image.file(File(capturedImage.path));
8890}
8991```
9092
Original file line number Diff line number Diff line change 1+ // Copyright 2013 The Flutter Authors. All rights reserved.
2+ // Use of this source code is governed by a BSD-style license that can be
3+ // found in the LICENSE file.
4+
5+ import 'dart:io' ;
6+
7+ import 'package:camera_platform_interface/camera_platform_interface.dart' ;
8+ import 'package:flutter/foundation.dart' ;
9+ import 'package:flutter/widgets.dart' ;
10+
11+ /// Demonstrates using an XFile result as an [Image] source, for the README.
12+ Image getImageFromResultExample (XFile capturedImage) {
13+ // #docregion ImageFromXFile
14+ final Image image;
15+ if (kIsWeb) {
16+ image = Image .network (capturedImage.path);
17+ } else {
18+ image = Image .file (File (capturedImage.path));
19+ }
20+ // #enddocregion ImageFromXFile
21+ return image;
22+ }
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ environment:
66 flutter : " >=3.3.0"
77
88dependencies :
9+ camera_platform_interface : ^2.1.0
10+ camera_web :
11+ path : ../
912 flutter :
1013 sdk : flutter
1114
1215dev_dependencies :
1316 async : ^2.5.0
14- camera_platform_interface : ^2.1.0
15- camera_web :
16- path : ../
1717 cross_file : ^0.3.1
1818 flutter_test :
1919 sdk : flutter
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: camera_web
22description : A Flutter plugin for getting information about and controlling the camera on Web.
33repository : https://github.com/flutter/packages/tree/main/packages/camera/camera_web
44issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
5- version : 0.3.2
5+ version : 0.3.2+1
66
77environment :
88 sdk : " >=2.18.0 <4.0.0"
Original file line number Diff line number Diff line change 55
66# TODO(stuartmorgan): Remove everything from this list. See
77# https://github.com/flutter/flutter/issues/102679
8- - camera_web
98- cross_file
109- css_colors
1110- espresso
You can’t perform that action at this time.
0 commit comments