Jonny Borges
Committed by GitHub

Merge pull request #2987 from devee-dev/master

switch to package:web to support wasm compilation
@@ -612,9 +612,12 @@ class GetDelegate extends RouterDelegate<RouteDecoder> @@ -612,9 +612,12 @@ class GetDelegate extends RouterDelegate<RouteDecoder>
612 }) async { 612 }) async {
613 // remove history or page entries until you meet route 613 // remove history or page entries until you meet route
614 var iterator = currentConfiguration; 614 var iterator = currentConfiguration;
615 - while (_canPop(popMode) &&  
616 - iterator != null &&  
617 - iterator.pageSettings?.name != fullRoute) { 615 + while (_canPop(popMode) && iterator != null) {
  616 + //the next line causes wasm compile error if included in the while loop
  617 + //https://github.com/flutter/flutter/issues/140110
  618 + if (iterator.pageSettings?.name == fullRoute) {
  619 + break;
  620 + }
618 await _pop(popMode, null); 621 await _pop(popMode, null);
619 // replace iterator 622 // replace iterator
620 iterator = currentConfiguration; 623 iterator = currentConfiguration;
@@ -40,7 +40,7 @@ extension PageArgExt on BuildContext { @@ -40,7 +40,7 @@ extension PageArgExt on BuildContext {
40 String get location { 40 String get location {
41 final parser = router.routeInformationParser; 41 final parser = router.routeInformationParser;
42 final config = delegate.currentConfiguration; 42 final config = delegate.currentConfiguration;
43 - return parser?.restoreRouteInformation(config)?.location ?? '/'; 43 + return parser?.restoreRouteInformation(config)?.uri.toString() ?? '/';
44 } 44 }
45 45
46 GetDelegate get delegate { 46 GetDelegate get delegate {
1 // ignore: avoid_web_libraries_in_flutter 1 // ignore: avoid_web_libraries_in_flutter
2 -import 'dart:html' as html; 2 +import 'package:web/web.dart' as html;
3 3
4 import '../../get_utils.dart'; 4 import '../../get_utils.dart';
5 5
@@ -25,7 +25,7 @@ class GeneralPlatform { @@ -25,7 +25,7 @@ class GeneralPlatform {
25 static bool get isIOS { 25 static bool get isIOS {
26 // maxTouchPoints is needed to separate iPad iOS13 vs new MacOS 26 // maxTouchPoints is needed to separate iPad iOS13 vs new MacOS
27 return GetUtils.hasMatch(_navigator.platform, r'/iPad|iPhone|iPod/') || 27 return GetUtils.hasMatch(_navigator.platform, r'/iPad|iPhone|iPod/') ||
28 - (_navigator.platform == 'MacIntel' && _navigator.maxTouchPoints! > 1); 28 + (_navigator.platform == 'MacIntel' && _navigator.maxTouchPoints > 1);
29 } 29 }
30 30
31 static bool get isFuchsia => false; 31 static bool get isFuchsia => false;
@@ -11,6 +11,7 @@ dependencies: @@ -11,6 +11,7 @@ dependencies:
11 sdk: flutter 11 sdk: flutter
12 flutter_web_plugins: 12 flutter_web_plugins:
13 sdk: flutter 13 sdk: flutter
  14 + web: any
14 15
15 dev_dependencies: 16 dev_dependencies:
16 flutter_lints: ^2.0.3 17 flutter_lints: ^2.0.3