Skip to content

Commit

Permalink
package_info_plus: migrate web to pkg:web
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Oct 30, 2023
1 parent 7ec4253 commit 3274588
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/package_info_plus/package_info_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
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 @@ -35,8 +35,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
6 changes: 3 additions & 3 deletions packages/package_info_plus/package_info_plus/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down 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

# win32 is compatible across v4 and v5 for Win32 only (not COM)
win32: ">=4.0.0 <6.0.0"
Expand All @@ -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

0 comments on commit 3274588

Please sign in to comment.