Skip to content
This repository was archived by the owner on Aug 15, 2026. It is now read-only.

Commit 142990b

Browse files
authored
[camera_web] Remove invalid @js annotation on extension type constructors (flutter#12384)
Removes invalid `@JS()` annotations from extension type constructors in `packages/camera/camera_web`. Fixes flutter/flutter#190355 ### Description In newer Dart SDKs (following Dart SDK commit dart-lang/sdk@cecd7ec rolled into Flutter in PR flutter/flutter#190158), placing `@JS()` annotations on extension type constructors has no effect and is now flagged as an error (`invalid_js_annotation`). Removing these annotations resolves the error without altering runtime behavior.
1 parent df17293 commit 142990b

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/camera/camera_web/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.5+5
2+
3+
* Removes invalid @JS annotation from extension type constructors.
4+
15
## 0.3.5+4
26

37
* Fixes a `TypeError` in `availableCameras()` caused by browsers (e.g. Firefox) returning

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ extension NonStandardFieldsOnMediaTrackSettings on MediaTrackSettings {
4343

4444
/// Brought over from package:web 1.0.0
4545
extension type WebTweakMediaSettingsRange._(JSObject _) implements JSObject {
46-
@JS('MediaSettingsRange')
4746
external factory WebTweakMediaSettingsRange({num max, num min, num step});
4847

4948
external double get max;
@@ -63,6 +62,5 @@ extension WebTweakMethodVersions on MediaStreamTrack {
6362
/// Allows creating the MediaTrackConstraints that are needed.
6463
/// Brought over from package:web 1.0.0
6564
extension type WebTweakMediaTrackConstraints._(JSObject _) implements JSObject {
66-
@JS('MediaTrackConstraints')
6765
external factory WebTweakMediaTrackConstraints({JSAny zoom, ConstrainBoolean torch});
6866
}

‎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+4
5+
version: 0.3.5+5
66

77
environment:
88
sdk: ^3.10.0

0 commit comments

Comments
 (0)