diff --git a/packages/package_info_plus/package_info_plus/CHANGELOG.md b/packages/package_info_plus/package_info_plus/CHANGELOG.md index 5aef64ccd0f..88837247d4a 100644 --- a/packages/package_info_plus/package_info_plus/CHANGELOG.md +++ b/packages/package_info_plus/package_info_plus/CHANGELOG.md @@ -1,3 +1,5 @@ +## 4.2.1-web + ## 4.2.0 > Info: This release is a replacement for release 5.0.0, which was retracted due to issue ([#2251](https://github.com/fluttercommunity/plus_plugins/issues/2251)). As breaking change was reverted the major release was also reverted in favor of this one. diff --git a/packages/package_info_plus/package_info_plus/lib/src/file_version_info.dart b/packages/package_info_plus/package_info_plus/lib/src/file_version_info.dart index ab5c4b4bf0d..3e383a8da95 100644 --- a/packages/package_info_plus/package_info_plus/lib/src/file_version_info.dart +++ b/packages/package_info_plus/package_info_plus/lib/src/file_version_info.dart @@ -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; diff --git a/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart index f11542abb47..fd50e79b537 100644 --- a/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart +++ b/packages/package_info_plus/package_info_plus/lib/src/package_info_plus_web.dart @@ -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]. /// @@ -35,8 +35,8 @@ class PackageInfoPlusWebPlugin extends PackageInfoPlatform { @override Future 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( diff --git a/packages/package_info_plus/package_info_plus/pubspec.yaml b/packages/package_info_plus/package_info_plus/pubspec.yaml index ed1f416a0fb..721ea937cc7 100644 --- a/packages/package_info_plus/package_info_plus/pubspec.yaml +++ b/packages/package_info_plus/package_info_plus/pubspec.yaml @@ -1,6 +1,6 @@ name: package_info_plus description: Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android. -version: 4.2.0 +version: 4.2.1-wip homepage: https://plus.fluttercommunity.dev/ repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus/package_info_plus issue_tracker: https://github.com/fluttercommunity/plus_plugins/labels/package_info_plus @@ -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 # win32 is compatible across v4 and v5 for Win32 only (not COM) win32: ">=4.0.0 <6.0.0" @@ -44,5 +45,4 @@ dev_dependencies: test: ^1.22.0 environment: - sdk: ">=2.18.0 <4.0.0" - flutter: ">=3.3.0" + sdk: ^3.2.0-dev