Skip to content

Commit 154e76c

Browse files
feat(device_info_plus)!: migrate to package:web (#2624)
1 parent 5b47746 commit 154e76c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/device_info_plus/device_info_plus/lib/src/device_info_plus_web.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'dart:async';
2-
import 'dart:html' as html show window, Navigator;
2+
import 'package:web/web.dart' as html show window, Navigator;
33

44
import 'package:device_info_plus_platform_interface/device_info_plus_platform_interface.dart';
55
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
@@ -44,3 +44,10 @@ class DeviceInfoPlusWebPlugin extends DeviceInfoPlatform {
4444
);
4545
}
4646
}
47+
48+
/// Property is missing.
49+
/// Ticket: https://github.com/dart-lang/web/issues/192
50+
/// Probably won't be an int? in the future!
51+
extension on html.Navigator {
52+
external int? get deviceMemory;
53+
}

packages/device_info_plus/device_info_plus/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies:
3333
flutter_web_plugins:
3434
sdk: flutter
3535
meta: ^1.8.0
36+
web: '>=0.5.0 <=0.6.0'
3637

3738
# win32 is compatible across v4 and v5 for Win32 only (not COM)
3839
win32: ">=4.0.0 <6.0.0"
@@ -46,5 +47,5 @@ dev_dependencies:
4647
test: ^1.22.0
4748

4849
environment:
49-
sdk: ">=2.18.0 <4.0.0"
50+
sdk: ">=3.3.0 <4.0.0"
5051
flutter: ">=3.3.0"

0 commit comments

Comments
 (0)