mirror of
https://github.com/flutter/packages.git
synced 2025-06-28 22:02:38 +08:00
[web] Use new APIs from dart:ui_web
(#4168)
The following APIs are now exposed through `dart:ui_web` which eliminates the need for shims:
- `platformViewRegistry`
- `webOnlyAssetManager`
- `urlStrategy`
## Issues
* Fixes https://github.com/flutter/flutter/issues/55000
## Minimal `stable` version
THIS PR CANNOT LAND UNTIL THE NEW `dart:ui_web` APIS MAKE IT INTO A STABLE FLUTTER RELEASE.
* Needs 5a7ab5a147
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
## 0.3.2+3
|
||||||
|
|
||||||
|
* Migrates to `dart:ui_web` APIs.
|
||||||
|
* Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.
|
||||||
|
|
||||||
## 0.3.2+2
|
## 0.3.2+2
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:camera_platform_interface/camera_platform_interface.dart';
|
import 'package:camera_platform_interface/camera_platform_interface.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
import 'camera_service.dart';
|
import 'camera_service.dart';
|
||||||
import 'shims/dart_ui.dart' as ui;
|
|
||||||
import 'types/types.dart';
|
import 'types/types.dart';
|
||||||
|
|
||||||
String _getViewType(int cameraId) => 'plugins.flutter.io/camera_$cameraId';
|
String _getViewType(int cameraId) => 'plugins.flutter.io/camera_$cameraId';
|
||||||
@ -168,7 +168,7 @@ class Camera {
|
|||||||
..style.setProperty('object-fit', 'cover')
|
..style.setProperty('object-fit', 'cover')
|
||||||
..append(videoElement);
|
..append(videoElement);
|
||||||
|
|
||||||
ui.platformViewRegistry.registerViewFactory(
|
ui_web.platformViewRegistry.registerViewFactory(
|
||||||
_getViewType(textureId),
|
_getViewType(textureId),
|
||||||
(_) => divElement,
|
(_) => divElement,
|
||||||
);
|
);
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
/// This file shims dart:ui in web-only scenarios, getting rid of the need to
|
|
||||||
/// suppress analyzer warnings.
|
|
||||||
|
|
||||||
// TODO(ditman): Remove this file once web-only dart:ui APIs are exposed from
|
|
||||||
// a dedicated place. https://github.com/flutter/flutter/issues/55000
|
|
||||||
export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
|
|
@ -1,33 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import 'dart:html' as html;
|
|
||||||
|
|
||||||
// Fake interface for the logic that this package needs from (web-only) dart:ui.
|
|
||||||
// This is conditionally exported so the analyzer sees these methods as available.
|
|
||||||
|
|
||||||
// ignore_for_file: avoid_classes_with_only_static_members
|
|
||||||
// ignore_for_file: camel_case_types
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.PlatformViewRegistry
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L62
|
|
||||||
class platformViewRegistry {
|
|
||||||
/// Shim for registerViewFactory
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L72
|
|
||||||
static bool registerViewFactory(
|
|
||||||
String viewTypeId, html.Element Function(int viewId) viewFactory) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.AssetManager.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L12
|
|
||||||
class webOnlyAssetManager {
|
|
||||||
/// Shim for getAssetUrl.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L45
|
|
||||||
static String getAssetUrl(String asset) => '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signature of callbacks that have no arguments and return no data.
|
|
||||||
typedef VoidCallback = void Function();
|
|
@ -1,5 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
export 'dart:ui';
|
|
@ -2,11 +2,11 @@ name: camera_web
|
|||||||
description: A Flutter plugin for getting information about and controlling the camera on Web.
|
description: A Flutter plugin for getting information about and controlling the camera on Web.
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_web
|
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_web
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
|
||||||
version: 0.3.2+2
|
version: 0.3.2+3
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
## 0.5.4+2
|
||||||
|
|
||||||
|
* Migrates to `dart:ui_web` APIs.
|
||||||
|
* Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.
|
||||||
|
|
||||||
## 0.5.4+1
|
## 0.5.4+1
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -6,8 +6,9 @@ library google_maps_flutter_web;
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:html';
|
import 'dart:html' hide VoidCallback;
|
||||||
import 'dart:js_util';
|
import 'dart:js_util';
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@ -21,7 +22,6 @@ import 'package:sanitize_html/sanitize_html.dart';
|
|||||||
import 'package:stream_transform/stream_transform.dart';
|
import 'package:stream_transform/stream_transform.dart';
|
||||||
|
|
||||||
import 'src/google_maps_inspector_web.dart';
|
import 'src/google_maps_inspector_web.dart';
|
||||||
import 'src/shims/dart_ui.dart' as ui; // Conditionally imports dart:ui in web
|
|
||||||
import 'src/third_party/to_screen_location/to_screen_location.dart';
|
import 'src/third_party/to_screen_location/to_screen_location.dart';
|
||||||
import 'src/types.dart';
|
import 'src/types.dart';
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ class CircleController {
|
|||||||
CircleController({
|
CircleController({
|
||||||
required gmaps.Circle circle,
|
required gmaps.Circle circle,
|
||||||
bool consumeTapEvents = false,
|
bool consumeTapEvents = false,
|
||||||
ui.VoidCallback? onTap,
|
VoidCallback? onTap,
|
||||||
}) : _circle = circle,
|
}) : _circle = circle,
|
||||||
_consumeTapEvents = consumeTapEvents {
|
_consumeTapEvents = consumeTapEvents {
|
||||||
if (onTap != null) {
|
if (onTap != null) {
|
||||||
|
@ -262,7 +262,7 @@ gmaps.Icon? _gmIconFromBitmapDescriptor(BitmapDescriptor bitmapDescriptor) {
|
|||||||
// iconConfig[2] contains the DPIs of the screen, but that information is
|
// iconConfig[2] contains the DPIs of the screen, but that information is
|
||||||
// already encoded in the iconConfig[1]
|
// already encoded in the iconConfig[1]
|
||||||
icon = gmaps.Icon()
|
icon = gmaps.Icon()
|
||||||
..url = ui.webOnlyAssetManager.getAssetUrl(iconConfig[1]! as String);
|
..url = ui_web.assetManager.getAssetUrl(iconConfig[1]! as String);
|
||||||
|
|
||||||
final gmaps.Size? size = _gmSizeFromIconConfig(iconConfig, 3);
|
final gmaps.Size? size = _gmSizeFromIconConfig(iconConfig, 3);
|
||||||
if (size != null) {
|
if (size != null) {
|
||||||
|
@ -41,7 +41,7 @@ class GoogleMapController {
|
|||||||
..style.width = '100%'
|
..style.width = '100%'
|
||||||
..style.height = '100%';
|
..style.height = '100%';
|
||||||
|
|
||||||
ui.platformViewRegistry.registerViewFactory(
|
ui_web.platformViewRegistry.registerViewFactory(
|
||||||
_getViewType(mapId),
|
_getViewType(mapId),
|
||||||
(int viewId) => _div,
|
(int viewId) => _div,
|
||||||
);
|
);
|
||||||
|
@ -14,7 +14,7 @@ class MarkerController {
|
|||||||
LatLngCallback? onDragStart,
|
LatLngCallback? onDragStart,
|
||||||
LatLngCallback? onDrag,
|
LatLngCallback? onDrag,
|
||||||
LatLngCallback? onDragEnd,
|
LatLngCallback? onDragEnd,
|
||||||
ui.VoidCallback? onTap,
|
VoidCallback? onTap,
|
||||||
}) : _marker = marker,
|
}) : _marker = marker,
|
||||||
_infoWindow = infoWindow,
|
_infoWindow = infoWindow,
|
||||||
_consumeTapEvents = consumeTapEvents {
|
_consumeTapEvents = consumeTapEvents {
|
||||||
|
@ -10,7 +10,7 @@ class PolygonController {
|
|||||||
PolygonController({
|
PolygonController({
|
||||||
required gmaps.Polygon polygon,
|
required gmaps.Polygon polygon,
|
||||||
bool consumeTapEvents = false,
|
bool consumeTapEvents = false,
|
||||||
ui.VoidCallback? onTap,
|
VoidCallback? onTap,
|
||||||
}) : _polygon = polygon,
|
}) : _polygon = polygon,
|
||||||
_consumeTapEvents = consumeTapEvents {
|
_consumeTapEvents = consumeTapEvents {
|
||||||
if (onTap != null) {
|
if (onTap != null) {
|
||||||
|
@ -10,7 +10,7 @@ class PolylineController {
|
|||||||
PolylineController({
|
PolylineController({
|
||||||
required gmaps.Polyline polyline,
|
required gmaps.Polyline polyline,
|
||||||
bool consumeTapEvents = false,
|
bool consumeTapEvents = false,
|
||||||
ui.VoidCallback? onTap,
|
VoidCallback? onTap,
|
||||||
}) : _polyline = polyline,
|
}) : _polyline = polyline,
|
||||||
_consumeTapEvents = consumeTapEvents {
|
_consumeTapEvents = consumeTapEvents {
|
||||||
if (onTap != null) {
|
if (onTap != null) {
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
/// This file shims dart:ui in web-only scenarios, getting rid of the need to
|
|
||||||
/// suppress analyzer warnings.
|
|
||||||
|
|
||||||
// TODO(ditman): Remove this file once web-only dart:ui APIs, https://github.com/flutter/flutter/issues/55000
|
|
||||||
// are exposed from a dedicated place.
|
|
||||||
export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
|
|
@ -1,33 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import 'dart:html' as html;
|
|
||||||
|
|
||||||
// Fake interface for the logic that this package needs from (web-only) dart:ui.
|
|
||||||
// This is conditionally exported so the analyzer sees these methods as available.
|
|
||||||
|
|
||||||
// ignore_for_file: avoid_classes_with_only_static_members
|
|
||||||
// ignore_for_file: camel_case_types
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.PlatformViewRegistry
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L62
|
|
||||||
class platformViewRegistry {
|
|
||||||
/// Shim for registerViewFactory
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L72
|
|
||||||
static bool registerViewFactory(
|
|
||||||
String viewTypeId, html.Element Function(int viewId) viewFactory) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.AssetManager.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L12
|
|
||||||
class webOnlyAssetManager {
|
|
||||||
/// Shim for getAssetUrl.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L45
|
|
||||||
static String getAssetUrl(String asset) => '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signature of callbacks that have no arguments and return no data.
|
|
||||||
typedef VoidCallback = void Function();
|
|
@ -1,5 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
export 'dart:ui';
|
|
@ -2,11 +2,11 @@ name: google_maps_flutter_web
|
|||||||
description: Web platform implementation of google_maps_flutter
|
description: Web platform implementation of google_maps_flutter
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web
|
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
|
||||||
version: 0.5.4+1
|
version: 0.5.4+2
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
## 0.12.0+5
|
||||||
|
|
||||||
|
* Migrates to `dart:ui_web` APIs.
|
||||||
|
* Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.
|
||||||
|
|
||||||
## 0.12.0+4
|
## 0.12.0+4
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
@ -157,8 +157,7 @@ class ResizableFromJs extends StatelessWidget {
|
|||||||
this.initialSize,
|
this.initialSize,
|
||||||
super.key,
|
super.key,
|
||||||
}) {
|
}) {
|
||||||
// ignore: avoid_dynamic_calls, undefined_prefixed_name
|
ui_web.platformViewRegistry.registerViewFactory(
|
||||||
ui.platformViewRegistry.registerViewFactory(
|
|
||||||
'resizable_from_js_$instanceId',
|
'resizable_from_js_$instanceId',
|
||||||
(int viewId) {
|
(int viewId) {
|
||||||
final DomHtmlElement element = document.createElement('div');
|
final DomHtmlElement element = document.createElement('div');
|
||||||
|
@ -2,8 +2,8 @@ name: google_sign_in_web_integration_tests
|
|||||||
publish_to: none
|
publish_to: none
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart' show visibleForTesting, kDebugMode;
|
import 'package:flutter/foundation.dart' show visibleForTesting, kDebugMode;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -172,8 +172,7 @@ class GoogleSignInPlugin extends GoogleSignInPlatform {
|
|||||||
|
|
||||||
// Register a factory for the Button HtmlElementView.
|
// Register a factory for the Button HtmlElementView.
|
||||||
void _registerButtonFactory() {
|
void _registerButtonFactory() {
|
||||||
// ignore: avoid_dynamic_calls, undefined_prefixed_name
|
ui_web.platformViewRegistry.registerViewFactory(
|
||||||
ui.platformViewRegistry.registerViewFactory(
|
|
||||||
'gsi_login_button',
|
'gsi_login_button',
|
||||||
(int viewId) {
|
(int viewId) {
|
||||||
final DomElement element = createDomElement('div');
|
final DomElement element = createDomElement('div');
|
||||||
|
@ -3,11 +3,11 @@ description: Flutter plugin for Google Sign-In, a secure authentication system
|
|||||||
for signing in with a Google account on Android, iOS and Web.
|
for signing in with a Google account on Android, iOS and Web.
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web
|
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
|
||||||
version: 0.12.0+4
|
version: 0.12.0+5
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
## 0.9.3+6
|
||||||
|
|
||||||
|
* Migrates to `dart:ui_web` APIs.
|
||||||
|
* Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.
|
||||||
|
|
||||||
## 0.9.3+5
|
## 0.9.3+5
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -4,12 +4,11 @@
|
|||||||
|
|
||||||
// ignore: avoid_web_libraries_in_flutter
|
// ignore: avoid_web_libraries_in_flutter
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||||
|
|
||||||
import 'src/shim/dart_ui.dart' as ui;
|
|
||||||
|
|
||||||
const String _htmlElementViewType = '_htmlElementViewType';
|
const String _htmlElementViewType = '_htmlElementViewType';
|
||||||
const double _videoWidth = 640;
|
const double _videoWidth = 640;
|
||||||
const double _videoHeight = 480;
|
const double _videoHeight = 480;
|
||||||
@ -42,7 +41,7 @@ html.Element htmlElement = html.DivElement()
|
|||||||
// ..style.border = 'none';
|
// ..style.border = 'none';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
ui.platformViewRegistry.registerViewFactory(
|
ui_web.platformViewRegistry.registerViewFactory(
|
||||||
_htmlElementViewType,
|
_htmlElementViewType,
|
||||||
(int viewId) => htmlElement,
|
(int viewId) => htmlElement,
|
||||||
);
|
);
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
/// This file shims dart:ui in web-only scenarios, getting rid of the need to
|
|
||||||
/// suppress analyzer warnings.
|
|
||||||
|
|
||||||
// TODO(dit): flutter/flutter#55000 Remove this file once web-only dart:ui APIs
|
|
||||||
// are exposed from a dedicated place.
|
|
||||||
export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
|
|
@ -1,32 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
// Fake interface for the logic that this package needs from (web-only) dart:ui.
|
|
||||||
// This is conditionally exported so the analyzer sees these methods as available.
|
|
||||||
|
|
||||||
// ignore: avoid_classes_with_only_static_members
|
|
||||||
/// Shim for web_ui engine.PlatformViewRegistry
|
|
||||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/ui.dart#L62
|
|
||||||
// ignore: camel_case_types
|
|
||||||
class platformViewRegistry {
|
|
||||||
/// Shim for registerViewFactory
|
|
||||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/ui.dart#L72
|
|
||||||
static void registerViewFactory(
|
|
||||||
String viewTypeId, dynamic Function(int viewId) viewFactory) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore: avoid_classes_with_only_static_members
|
|
||||||
/// Shim for web_ui engine.AssetManager.
|
|
||||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/src/engine/assets.dart#L12
|
|
||||||
// ignore: camel_case_types
|
|
||||||
class webOnlyAssetManager {
|
|
||||||
/// Shim for getAssetUrl.
|
|
||||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/src/engine/assets.dart#L45
|
|
||||||
static String getAssetUrl(String asset) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signature of callbacks that have no arguments and return no data.
|
|
||||||
typedef VoidCallback = void Function();
|
|
@ -1,5 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
export 'dart:ui';
|
|
@ -4,8 +4,8 @@ publish_to: 'none'
|
|||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
/// This file shims dart:ui in web-only scenarios, getting rid of the need to
|
|
||||||
/// suppress analyzer warnings.
|
|
||||||
|
|
||||||
// TODO(dit): flutter/flutter#55000 Remove this file once web-only dart:ui APIs
|
|
||||||
// are exposed from a dedicated place.
|
|
||||||
export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
|
|
@ -1,33 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
// Fake interface for the logic that this package needs from (web-only) dart:ui.
|
|
||||||
// This is conditionally exported so the analyzer sees these methods as available.
|
|
||||||
|
|
||||||
// ignore: avoid_classes_with_only_static_members
|
|
||||||
/// Shim for web_ui engine.PlatformViewRegistry
|
|
||||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/ui.dart#L62
|
|
||||||
// ignore: camel_case_types
|
|
||||||
class platformViewRegistry {
|
|
||||||
/// Shim for registerViewFactory
|
|
||||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/ui.dart#L72
|
|
||||||
static void registerViewFactory(
|
|
||||||
String viewTypeId, dynamic Function(int viewId) viewFactory,
|
|
||||||
{bool isVisible = true}) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ignore: avoid_classes_with_only_static_members
|
|
||||||
/// Shim for web_ui engine.AssetManager.
|
|
||||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/src/engine/assets.dart#L12
|
|
||||||
// ignore: camel_case_types
|
|
||||||
class webOnlyAssetManager {
|
|
||||||
/// Shim for getAssetUrl.
|
|
||||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/src/engine/assets.dart#L45
|
|
||||||
static String getAssetUrl(String asset) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signature of callbacks that have no arguments and return no data.
|
|
||||||
typedef VoidCallback = void Function();
|
|
@ -1,5 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
export 'dart:ui';
|
|
@ -4,11 +4,10 @@
|
|||||||
|
|
||||||
// ignore: avoid_web_libraries_in_flutter
|
// ignore: avoid_web_libraries_in_flutter
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
import 'shim/dart_ui.dart' as ui;
|
|
||||||
|
|
||||||
const String _viewType = '__webPointerInterceptorViewType__';
|
const String _viewType = '__webPointerInterceptorViewType__';
|
||||||
const String _debug = 'debug__';
|
const String _debug = 'debug__';
|
||||||
|
|
||||||
@ -20,7 +19,7 @@ String _getViewType({bool debug = false}) {
|
|||||||
// Registers a viewFactory for this widget.
|
// Registers a viewFactory for this widget.
|
||||||
void _registerFactory({bool debug = false}) {
|
void _registerFactory({bool debug = false}) {
|
||||||
final String viewType = _getViewType(debug: debug);
|
final String viewType = _getViewType(debug: debug);
|
||||||
ui.platformViewRegistry.registerViewFactory(viewType, (int viewId) {
|
ui_web.platformViewRegistry.registerViewFactory(viewType, (int viewId) {
|
||||||
final html.Element htmlElement = html.DivElement()
|
final html.Element htmlElement = html.DivElement()
|
||||||
..style.width = '100%'
|
..style.width = '100%'
|
||||||
..style.height = '100%';
|
..style.height = '100%';
|
||||||
|
@ -2,11 +2,11 @@ name: pointer_interceptor
|
|||||||
description: A widget to prevent clicks from being swallowed by underlying HtmlElementViews on the web.
|
description: A widget to prevent clicks from being swallowed by underlying HtmlElementViews on the web.
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor
|
repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pointer_interceptor%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pointer_interceptor%22
|
||||||
version: 0.9.3+5
|
version: 0.9.3+6
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
## 2.0.20
|
||||||
|
|
||||||
|
* Migrates to `dart:ui_web` APIs.
|
||||||
|
* Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.
|
||||||
|
|
||||||
## 2.0.19
|
## 2.0.19
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
import 'dart:js_util';
|
import 'dart:js_util';
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
|
||||||
import 'package:integration_test/integration_test.dart';
|
import 'package:integration_test/integration_test.dart';
|
||||||
import 'package:url_launcher_platform_interface/link.dart';
|
import 'package:url_launcher_platform_interface/link.dart';
|
||||||
import 'package:url_launcher_web/src/link.dart';
|
import 'package:url_launcher_web/src/link.dart';
|
||||||
@ -69,7 +69,7 @@ void main() {
|
|||||||
// Check that internal route properly prepares using the default
|
// Check that internal route properly prepares using the default
|
||||||
// [UrlStrategy]
|
// [UrlStrategy]
|
||||||
expect(anchor.getAttribute('href'),
|
expect(anchor.getAttribute('href'),
|
||||||
urlStrategy?.prepareExternalUrl(uri3.toString()));
|
ui_web.urlStrategy?.prepareExternalUrl(uri3.toString()));
|
||||||
expect(anchor.getAttribute('target'), '_self');
|
expect(anchor.getAttribute('target'), '_self');
|
||||||
|
|
||||||
// Needed when testing on on Chrome98 headless in CI.
|
// Needed when testing on on Chrome98 headless in CI.
|
||||||
|
@ -2,8 +2,8 @@ name: regular_integration_tests
|
|||||||
publish_to: none
|
publish_to: none
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
@ -13,8 +13,6 @@ dev_dependencies:
|
|||||||
build_runner: ^2.1.1
|
build_runner: ^2.1.1
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_web_plugins:
|
|
||||||
sdk: flutter
|
|
||||||
integration_test:
|
integration_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
mockito: 5.4.1
|
mockito: 5.4.1
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
import 'dart:js_util';
|
import 'dart:js_util';
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_web_plugins/flutter_web_plugins.dart' show urlStrategy;
|
|
||||||
import 'package:url_launcher_platform_interface/link.dart';
|
import 'package:url_launcher_platform_interface/link.dart';
|
||||||
|
|
||||||
/// The unique identifier for the view type to be used for link platform views.
|
/// The unique identifier for the view type to be used for link platform views.
|
||||||
@ -225,7 +225,7 @@ class LinkViewController extends PlatformViewController {
|
|||||||
// in case an internal uri is given, the url mus be properly encoded
|
// in case an internal uri is given, the url mus be properly encoded
|
||||||
// using the currently used [UrlStrategy]
|
// using the currently used [UrlStrategy]
|
||||||
if (!uri.hasScheme) {
|
if (!uri.hasScheme) {
|
||||||
href = urlStrategy?.prepareExternalUrl(href) ?? href;
|
href = ui_web.urlStrategy?.prepareExternalUrl(href) ?? href;
|
||||||
}
|
}
|
||||||
_element.setAttribute('href', href);
|
_element.setAttribute('href', href);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
/// This file shims dart:ui in web-only scenarios, getting rid of the need to
|
|
||||||
/// suppress analyzer warnings.
|
|
||||||
|
|
||||||
// TODO(ditman): Remove this file once web-only dart:ui APIs
|
|
||||||
// are exposed from a dedicated place, flutter/flutter#55000.
|
|
||||||
export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
|
|
@ -1,34 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import 'dart:html' as html;
|
|
||||||
|
|
||||||
// Fake interface for the logic that this package needs from (web-only) dart:ui.
|
|
||||||
// This is conditionally exported so the analyzer sees these methods as available.
|
|
||||||
|
|
||||||
// ignore_for_file: avoid_classes_with_only_static_members
|
|
||||||
// ignore_for_file: camel_case_types
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.PlatformViewRegistry
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L62
|
|
||||||
class platformViewRegistry {
|
|
||||||
/// Shim for registerViewFactory
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L72
|
|
||||||
static bool registerViewFactory(
|
|
||||||
String viewTypeId, html.Element Function(int viewId) viewFactory,
|
|
||||||
{bool isVisible = true}) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.AssetManager.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L12
|
|
||||||
class webOnlyAssetManager {
|
|
||||||
/// Shim for getAssetUrl.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L45
|
|
||||||
static String getAssetUrl(String asset) => '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signature of callbacks that have no arguments and return no data.
|
|
||||||
typedef VoidCallback = void Function();
|
|
@ -1,5 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
export 'dart:ui';
|
|
@ -4,14 +4,14 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart' show visibleForTesting;
|
import 'package:flutter/foundation.dart' show visibleForTesting;
|
||||||
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
import 'package:flutter_web_plugins/flutter_web_plugins.dart' show Registrar;
|
||||||
import 'package:url_launcher_platform_interface/link.dart';
|
import 'package:url_launcher_platform_interface/link.dart';
|
||||||
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
|
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
|
||||||
|
|
||||||
import 'src/link.dart';
|
import 'src/link.dart';
|
||||||
import 'src/shims/dart_ui.dart' as ui;
|
|
||||||
|
|
||||||
const Set<String> _safariTargetTopSchemes = <String>{
|
const Set<String> _safariTargetTopSchemes = <String>{
|
||||||
'mailto',
|
'mailto',
|
||||||
@ -49,7 +49,7 @@ class UrlLauncherPlugin extends UrlLauncherPlatform {
|
|||||||
/// Registers this class as the default instance of [UrlLauncherPlatform].
|
/// Registers this class as the default instance of [UrlLauncherPlatform].
|
||||||
static void registerWith(Registrar registrar) {
|
static void registerWith(Registrar registrar) {
|
||||||
UrlLauncherPlatform.instance = UrlLauncherPlugin();
|
UrlLauncherPlatform.instance = UrlLauncherPlugin();
|
||||||
ui.platformViewRegistry
|
ui_web.platformViewRegistry
|
||||||
.registerViewFactory(linkViewType, linkViewFactory, isVisible: false);
|
.registerViewFactory(linkViewType, linkViewFactory, isVisible: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ name: url_launcher_web
|
|||||||
description: Web platform implementation of url_launcher
|
description: Web platform implementation of url_launcher
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_web
|
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_web
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
|
||||||
version: 2.0.19
|
version: 2.0.20
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
## 2.0.18
|
||||||
|
|
||||||
|
* Migrates to `dart:ui_web` APIs.
|
||||||
|
* Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.
|
||||||
|
|
||||||
## 2.0.17
|
## 2.0.17
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
/// This file shims dart:ui in web-only scenarios, getting rid of the need to
|
|
||||||
/// suppress analyzer warnings.
|
|
||||||
|
|
||||||
// TODO(ditman): Remove this file once web-only dart:ui APIs are exposed from
|
|
||||||
// a dedicated place, https://github.com/flutter/flutter/issues/55000
|
|
||||||
export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
|
|
@ -1,33 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import 'dart:html' as html;
|
|
||||||
|
|
||||||
// Fake interface for the logic that this package needs from (web-only) dart:ui.
|
|
||||||
// This is conditionally exported so the analyzer sees these methods as available.
|
|
||||||
|
|
||||||
// ignore_for_file: avoid_classes_with_only_static_members
|
|
||||||
// ignore_for_file: camel_case_types
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.PlatformViewRegistry
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L62
|
|
||||||
class platformViewRegistry {
|
|
||||||
/// Shim for registerViewFactory
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L72
|
|
||||||
static bool registerViewFactory(
|
|
||||||
String viewTypeId, html.Element Function(int viewId) viewFactory) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.AssetManager.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L12
|
|
||||||
class webOnlyAssetManager {
|
|
||||||
/// Shim for getAssetUrl.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L45
|
|
||||||
static String getAssetUrl(String asset) => '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signature of callbacks that have no arguments and return no data.
|
|
||||||
typedef VoidCallback = void Function();
|
|
@ -1,5 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
export 'dart:ui';
|
|
@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:html';
|
import 'dart:html';
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
||||||
import 'package:video_player_platform_interface/video_player_platform_interface.dart';
|
import 'package:video_player_platform_interface/video_player_platform_interface.dart';
|
||||||
|
|
||||||
import 'src/shims/dart_ui.dart' as ui;
|
|
||||||
import 'src/video_player.dart';
|
import 'src/video_player.dart';
|
||||||
|
|
||||||
/// The web implementation of [VideoPlayerPlatform].
|
/// The web implementation of [VideoPlayerPlatform].
|
||||||
@ -62,7 +62,7 @@ class VideoPlayerPlugin extends VideoPlayerPlatform {
|
|||||||
if (dataSource.package != null && dataSource.package!.isNotEmpty) {
|
if (dataSource.package != null && dataSource.package!.isNotEmpty) {
|
||||||
assetUrl = 'packages/${dataSource.package}/$assetUrl';
|
assetUrl = 'packages/${dataSource.package}/$assetUrl';
|
||||||
}
|
}
|
||||||
assetUrl = ui.webOnlyAssetManager.getAssetUrl(assetUrl);
|
assetUrl = ui_web.assetManager.getAssetUrl(assetUrl);
|
||||||
uri = assetUrl;
|
uri = assetUrl;
|
||||||
break;
|
break;
|
||||||
case DataSourceType.file:
|
case DataSourceType.file:
|
||||||
@ -81,7 +81,7 @@ class VideoPlayerPlugin extends VideoPlayerPlatform {
|
|||||||
..style.width = '100%';
|
..style.width = '100%';
|
||||||
|
|
||||||
// TODO(hterkelsen): Use initialization parameters once they are available
|
// TODO(hterkelsen): Use initialization parameters once they are available
|
||||||
ui.platformViewRegistry.registerViewFactory(
|
ui_web.platformViewRegistry.registerViewFactory(
|
||||||
'videoPlayer-$textureId', (int viewId) => videoElement);
|
'videoPlayer-$textureId', (int viewId) => videoElement);
|
||||||
|
|
||||||
final VideoPlayer player = VideoPlayer(videoElement: videoElement)
|
final VideoPlayer player = VideoPlayer(videoElement: videoElement)
|
||||||
|
@ -2,11 +2,11 @@ name: video_player_web
|
|||||||
description: Web platform implementation of video_player.
|
description: Web platform implementation of video_player.
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_web
|
repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_web
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
|
||||||
version: 2.0.17
|
version: 2.0.18
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
## 0.2.2+3
|
||||||
|
|
||||||
|
* Migrates to `dart:ui_web` APIs.
|
||||||
|
* Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.
|
||||||
|
|
||||||
## 0.2.2+2
|
## 0.2.2+2
|
||||||
|
|
||||||
* Adds pub topics to package metadata.
|
* Adds pub topics to package metadata.
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
/// This file shims dart:ui in web-only scenarios, getting rid of the need to
|
|
||||||
/// suppress analyzer warnings.
|
|
||||||
|
|
||||||
// TODO(BeMacized): Remove this file once web-only dart:ui APIs,
|
|
||||||
// are exposed from a dedicated place. flutter/flutter#55000
|
|
||||||
export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
|
|
@ -1,33 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import 'dart:html' as html;
|
|
||||||
|
|
||||||
// Fake interface for the logic that this package needs from (web-only) dart:ui.
|
|
||||||
// This is conditionally exported so the analyzer sees these methods as available.
|
|
||||||
|
|
||||||
// ignore_for_file: avoid_classes_with_only_static_members
|
|
||||||
// ignore_for_file: camel_case_types
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.PlatformViewRegistry
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L62
|
|
||||||
class platformViewRegistry {
|
|
||||||
/// Shim for registerViewFactory
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/ui.dart#L72
|
|
||||||
static bool registerViewFactory(
|
|
||||||
String viewTypeId, html.Element Function(int viewId) viewFactory) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Shim for web_ui engine.AssetManager.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L12
|
|
||||||
class webOnlyAssetManager {
|
|
||||||
/// Shim for getAssetUrl.
|
|
||||||
/// https://github.com/flutter/engine/blob/main/lib/web_ui/lib/src/engine/assets.dart#L45
|
|
||||||
static String getAssetUrl(String asset) => '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signature of callbacks that have no arguments and return no data.
|
|
||||||
typedef VoidCallback = void Function();
|
|
@ -1,5 +0,0 @@
|
|||||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
export 'dart:ui';
|
|
@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart';
|
import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart';
|
||||||
|
|
||||||
import 'content_type.dart';
|
import 'content_type.dart';
|
||||||
import 'http_request_factory.dart';
|
import 'http_request_factory.dart';
|
||||||
import 'shims/dart_ui.dart' as ui;
|
|
||||||
|
|
||||||
/// An implementation of [PlatformWebViewControllerCreationParams] using Flutter
|
/// An implementation of [PlatformWebViewControllerCreationParams] using Flutter
|
||||||
/// for Web API.
|
/// for Web API.
|
||||||
@ -115,7 +115,7 @@ class WebWebViewWidget extends PlatformWebViewWidget {
|
|||||||
: super.implementation(params) {
|
: super.implementation(params) {
|
||||||
final WebWebViewController controller =
|
final WebWebViewController controller =
|
||||||
params.controller as WebWebViewController;
|
params.controller as WebWebViewController;
|
||||||
ui.platformViewRegistry.registerViewFactory(
|
ui_web.platformViewRegistry.registerViewFactory(
|
||||||
controller._webWebViewParams.iFrame.id,
|
controller._webWebViewParams.iFrame.id,
|
||||||
(int viewId) => controller._webWebViewParams.iFrame,
|
(int viewId) => controller._webWebViewParams.iFrame,
|
||||||
);
|
);
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:html';
|
import 'dart:html';
|
||||||
|
import 'dart:ui_web' as ui_web;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
@ -12,7 +14,6 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
|||||||
// ignore: implementation_imports
|
// ignore: implementation_imports
|
||||||
import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart';
|
import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart';
|
||||||
import 'http_request_factory.dart';
|
import 'http_request_factory.dart';
|
||||||
import 'shims/dart_ui.dart' as ui;
|
|
||||||
|
|
||||||
/// Builds an iframe based WebView.
|
/// Builds an iframe based WebView.
|
||||||
///
|
///
|
||||||
@ -20,7 +21,7 @@ import 'shims/dart_ui.dart' as ui;
|
|||||||
class WebWebViewPlatform implements WebViewPlatform {
|
class WebWebViewPlatform implements WebViewPlatform {
|
||||||
/// Constructs a new instance of [WebWebViewPlatform].
|
/// Constructs a new instance of [WebWebViewPlatform].
|
||||||
WebWebViewPlatform() {
|
WebWebViewPlatform() {
|
||||||
ui.platformViewRegistry.registerViewFactory(
|
ui_web.platformViewRegistry.registerViewFactory(
|
||||||
'webview-iframe',
|
'webview-iframe',
|
||||||
(int viewId) => IFrameElement()
|
(int viewId) => IFrameElement()
|
||||||
..id = 'webview-$viewId'
|
..id = 'webview-$viewId'
|
||||||
|
@ -2,11 +2,11 @@ name: webview_flutter_web
|
|||||||
description: A Flutter plugin that provides a WebView widget on web.
|
description: A Flutter plugin that provides a WebView widget on web.
|
||||||
repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_web
|
repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_web
|
||||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
|
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
|
||||||
version: 0.2.2+2
|
version: 0.2.2+3
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
flutter: ">=3.7.0"
|
flutter: ">=3.13.0"
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
|
Reference in New Issue
Block a user