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
+
1
5
## 0.3.2
2
6
3
7
* 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
80
80
81
81
See the example below:
82
82
83
+ <? code-excerpt "example/lib/readme_excerpts.dart (ImageFromXFile)"?>
83
84
``` dart
85
+ final Image image;
84
86
if (kIsWeb) {
85
- Image.network(capturedImage.path);
87
+ image = Image.network(capturedImage.path);
86
88
} else {
87
- Image.file(File(capturedImage.path));
89
+ image = Image.file(File(capturedImage.path));
88
90
}
89
91
```
90
92
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:
6
6
flutter : " >=3.3.0"
7
7
8
8
dependencies :
9
+ camera_platform_interface : ^2.1.0
10
+ camera_web :
11
+ path : ../
9
12
flutter :
10
13
sdk : flutter
11
14
12
15
dev_dependencies :
13
16
async : ^2.5.0
14
- camera_platform_interface : ^2.1.0
15
- camera_web :
16
- path : ../
17
17
cross_file : ^0.3.1
18
18
flutter_test :
19
19
sdk : flutter
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: camera_web
2
2
description : A Flutter plugin for getting information about and controlling the camera on Web.
3
3
repository : https://github.com/flutter/packages/tree/main/packages/camera/camera_web
4
4
issue_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
6
6
7
7
environment :
8
8
sdk : " >=2.18.0 <4.0.0"
Original file line number Diff line number Diff line change 5
5
6
6
# TODO(stuartmorgan): Remove everything from this list. See
7
7
# https://github.com/flutter/flutter/issues/102679
8
- - camera_web
9
8
- cross_file
10
9
- css_colors
11
10
- espresso
You can’t perform that action at this time.
0 commit comments