From f8540442d20dc22f14f92af15453ff9add8c0b29 Mon Sep 17 00:00:00 2001 From: Miguel Beltran Date: Thu, 29 Feb 2024 08:20:44 +0100 Subject: [PATCH] migrate device_info_plus to package:web --- .../device_info_plus/lib/src/device_info_plus_web.dart | 6 ++++-- packages/device_info_plus/device_info_plus/pubspec.yaml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/device_info_plus/device_info_plus/lib/src/device_info_plus_web.dart b/packages/device_info_plus/device_info_plus/lib/src/device_info_plus_web.dart index fd3fee6442..9c6c61556c 100644 --- a/packages/device_info_plus/device_info_plus/lib/src/device_info_plus_web.dart +++ b/packages/device_info_plus/device_info_plus/lib/src/device_info_plus_web.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'dart:html' as html show window, Navigator; +import 'package:web/web.dart' as html show window, Navigator; import 'package:device_info_plus_platform_interface/device_info_plus_platform_interface.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart'; @@ -28,7 +28,9 @@ class DeviceInfoPlusWebPlugin extends DeviceInfoPlatform { 'appCodeName': _navigator.appCodeName, 'appName': _navigator.appName, 'appVersion': _navigator.appVersion, - 'deviceMemory': _navigator.deviceMemory, + // property is missing. + // ticket: https://github.com/dart-lang/web/issues/192 + // 'deviceMemory': _navigator.deviceMemory, 'language': _navigator.language, 'languages': _navigator.languages, 'platform': _navigator.platform, diff --git a/packages/device_info_plus/device_info_plus/pubspec.yaml b/packages/device_info_plus/device_info_plus/pubspec.yaml index d9ef03442c..5de69583aa 100644 --- a/packages/device_info_plus/device_info_plus/pubspec.yaml +++ b/packages/device_info_plus/device_info_plus/pubspec.yaml @@ -33,6 +33,7 @@ dependencies: flutter_web_plugins: sdk: flutter meta: ^1.8.0 + web: '>=0.3.0 <=0.6.0' # win32 is compatible across v4 and v5 for Win32 only (not COM) win32: ">=4.0.0 <6.0.0" @@ -46,5 +47,5 @@ dev_dependencies: test: ^1.22.0 environment: - sdk: ">=2.18.0 <4.0.0" + sdk: ">=3.2.0 <4.0.0" flutter: ">=3.3.0"