Skip to content

Commit 34746bb

Browse files
authored
Remove dart:html and drawImageScaled usages (#10411)
Fixes flutter/flutter#178123 Fixes flutter/flutter#178129
1 parent e5750bc commit 34746bb

File tree

11 files changed

+18
-14
lines changed

11 files changed

+18
-14
lines changed

packages/camera/camera_web/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 0.3.5+1
22

3+
* Uses `CanvasRenderingContext2D.drawImage` instead of the deprecated `drawImageScaled`.
34
* Updates minimum supported SDK version to Flutter 3.32/Dart 3.8.
45

56
## 0.3.5

packages/camera/camera_web/lib/src/camera.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class Camera {
267267
..scale(-1, 1);
268268
}
269269

270-
canvas.context2D.drawImageScaled(
270+
canvas.context2D.drawImage(
271271
videoElement,
272272
0,
273273
0,

packages/camera/camera_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera_web
22
description: A Flutter plugin for getting information about and controlling the camera on Web.
33
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_web
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
5-
version: 0.3.5
5+
version: 0.3.5+1
66

77
environment:
88
sdk: ^3.8.0

packages/cross_file/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 0.3.5+1
22

3+
* Replaces README mentions of `dart:html` with `package:web`.
34
* Updates minimum supported SDK version to Flutter 3.32/Dart 3.8.
45

56
## 0.3.5

packages/cross_file/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ programmatically.
4646
## Testing
4747

4848
This package supports both web and native platforms. Unit tests need to be split
49-
in two separate suites (because native code cannot use `dart:html`, and web code
49+
in two separate suites (because native code cannot use `package:web`, and web code
5050
cannot use `dart:io`).
5151

5252
When adding new features, it is likely that tests need to be added for both the

packages/cross_file/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: cross_file
22
description: An abstraction to allow working with files across multiple platforms.
33
repository: https://github.com/flutter/packages/tree/main/packages/cross_file
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cross_file%22
5-
version: 0.3.5
5+
version: 0.3.5+1
66

77
environment:
88
sdk: ^3.8.0

packages/image_picker/image_picker_for_web/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## NEXT
1+
## 3.1.1
22

3+
* Uses `CanvasRenderingContext2D.drawImage` instead of the deprecated `drawImageScaled`.
34
* Updates minimum supported SDK version to Flutter 3.32/Dart 3.8.
45

56
## 3.1.0

packages/image_picker/image_picker_for_web/lib/src/image_resizer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ImageResizer {
8383
if (maxHeight == null && maxWidth == null) {
8484
context.drawImage(source, 0, 0);
8585
} else {
86-
context.drawImageScaled(
86+
context.drawImage(
8787
source,
8888
0,
8989
0,

packages/image_picker/image_picker_for_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: image_picker_for_web
22
description: Web platform implementation of image_picker
33
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_for_web
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
5-
version: 3.1.0
5+
version: 3.1.1
66

77
environment:
88
sdk: ^3.8.0

packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_web.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
import 'dart:html' as html;
65
import 'dart:ui_web' as ui_web;
76

87
import 'package:flutter/material.dart';
8+
import 'package:web/web.dart' as web;
99

10-
/// The html.Element that will be rendered underneath the flutter UI.
11-
html.Element htmlElement = html.DivElement()
10+
/// The web.HTMLElement that will be rendered underneath the flutter UI.
11+
final web.HTMLElement htmlElement = web.HTMLDivElement()
1212
..style.width = '100%'
1313
..style.height = '100%'
1414
..style.backgroundColor = '#fabada'
@@ -17,7 +17,7 @@ html.Element htmlElement = html.DivElement()
1717

1818
// See other examples commented out below...
1919

20-
// html.Element htmlElement = html.VideoElement()
20+
// final web.HTMLElement htmlElement = web.HTMLVideoElement()
2121
// ..style.width = '100%'
2222
// ..style.height = '100%'
2323
// ..style.cursor = 'auto'
@@ -27,7 +27,7 @@ html.Element htmlElement = html.DivElement()
2727
// ..poster = 'https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217'
2828
// ..controls = true;
2929

30-
// html.Element htmlElement = html.IFrameElement()
30+
// final web.HTMLElement htmlElement = web.HTMLIFrameElement()
3131
// ..width = '100%'
3232
// ..height = '100%'
3333
// ..id = 'background-html-view'

0 commit comments

Comments
 (0)