Skip to content

Commit

Permalink
fix(package_info_plus): migrate to pkg:web from dart:html (#2316)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Nov 20, 2023
1 parent 32652b8 commit 450aeb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'dart:io';
import 'package:ffi/ffi.dart';
import 'package:win32/win32.dart';

class LANGANDCODEPAGE extends Struct {
base class LANGANDCODEPAGE extends Struct {
@WORD()
external int wLanguage;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'dart:convert';
import 'dart:html';

import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:http/http.dart';
import 'package:package_info_plus_platform_interface/package_info_data.dart';
import 'package:package_info_plus_platform_interface/package_info_platform_interface.dart';
import 'package:web/helpers.dart' as web;

/// The web implementation of [PackageInfoPlatform].
///
Expand Down Expand Up @@ -51,8 +51,8 @@ class PackageInfoPlusWebPlugin extends PackageInfoPlatform {
@override
Future<PackageInfoData> getAll() async {
final cacheBuster = DateTime.now().millisecondsSinceEpoch;
final url = versionJsonUrl(window.document.baseUri!, cacheBuster);
final response = _client == null ? await get(url) : await _client!.get(url);
final url = versionJsonUrl(web.window.document.baseURI, cacheBuster);
final response = _client == null ? await get(url) : await _client.get(url);
final versionMap = _getVersionMap(response);

return PackageInfoData(
Expand Down
5 changes: 3 additions & 2 deletions packages/package_info_plus/package_info_plus/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
meta: ^1.8.0
path: ^1.8.2
package_info_plus_platform_interface: ^2.0.1
web: '>=0.3.0 <0.5.0'

# win32 is compatible across v4 and v5 for Win32 only (not COM)
win32: ">=4.0.0 <6.0.0"
Expand All @@ -44,5 +45,5 @@ dev_dependencies:
test: ^1.22.0

environment:
sdk: ">=2.18.0 <4.0.0"
flutter: ">=3.3.0"
sdk: ^3.2.0
flutter: '>=3.6.0'

0 comments on commit 450aeb5

Please sign in to comment.