diff --git a/CHANGELOG.md b/CHANGELOG.md index b2a8679..ec77ceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [2.0.16] - 2024-05-19 +* Support to Flutter web WASM + ## [2.0.15] - 2024-05-19 * Update with flutter 3.22.0 diff --git a/example/pubspec.lock b/example/pubspec.lock index ed9e1b0..d3c34f9 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -15,7 +15,7 @@ packages: path: ".." relative: true source: path - version: "2.0.14" + version: "2.0.15" boolean_selector: dependency: transitive description: @@ -204,6 +204,14 @@ packages: url: "https://pub.dev" source: hosted version: "14.2.1" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" sdks: dart: ">=3.3.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/lib/awesome_extensions.dart b/lib/awesome_extensions.dart index df8fdbf..ad72124 100644 --- a/lib/awesome_extensions.dart +++ b/lib/awesome_extensions.dart @@ -40,3 +40,4 @@ part 'widget_extensions/padding_extension.dart'; part 'widget_extensions/positioned_extension.dart'; part 'widget_extensions/shimmer_extension.dart'; part 'widget_extensions/tooltip_extension.dart'; +part 'widget_extensions/sliver_extension.dart'; diff --git a/lib/src/platform/platform_web.dart b/lib/src/platform/platform_web.dart index 3a86c66..a4f6d27 100644 --- a/lib/src/platform/platform_web.dart +++ b/lib/src/platform/platform_web.dart @@ -1,5 +1,4 @@ -// ignore: avoid_web_libraries_in_flutter -import 'dart:html' as html; +import 'package:web/web.dart' as html; html.Navigator _navigator = html.window.navigator; @@ -15,7 +14,7 @@ class GeneralPlatform { static bool get isIOS { // maxTouchPoints is needed to separate iPad iOS13 vs new MacOS return hasMatch(_navigator.platform, r'/iPad|iPhone|iPod/') || - (_navigator.platform == 'MacIntel' && _navigator.maxTouchPoints! > 1); + (_navigator.platform == 'MacIntel' && _navigator.maxTouchPoints > 1); } static bool get isLinux => diff --git a/lib/sliver_extension.dart b/lib/widget_extensions/sliver_extension.dart similarity index 75% rename from lib/sliver_extension.dart rename to lib/widget_extensions/sliver_extension.dart index aa2e8f1..c7ccac2 100644 --- a/lib/sliver_extension.dart +++ b/lib/widget_extensions/sliver_extension.dart @@ -1,4 +1,4 @@ -import 'package:flutter/widgets.dart'; +part of '../awesome_extensions.dart'; extension WidgetSliver on Widget { Widget get sliver { diff --git a/pubspec.lock b/pubspec.lock index 18fdd0e..9a70185 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -205,6 +205,14 @@ packages: url: "https://pub.dev" source: hosted version: "14.2.1" + web: + dependency: "direct main" + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" sdks: dart: ">=3.3.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index a821fa9..545302b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,6 +14,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter + web: ^0.5.1 dev_dependencies: flutter_test: