This repository was archived by the owner on Jan 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +113
-2
lines changed Expand file tree Collapse file tree 6 files changed +113
-2
lines changed Original file line number Diff line number Diff line change
1
+ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
1
2
#include "Generated.xcconfig"
Original file line number Diff line number Diff line change
1
+ #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
1
2
#include "Generated.xcconfig"
Original file line number Diff line number Diff line change @@ -43,6 +43,34 @@ packages:
43
43
url: "https://pub.dartlang.org"
44
44
source: hosted
45
45
version: "1.15.0"
46
+ connectivity:
47
+ dependency: transitive
48
+ description:
49
+ name: connectivity
50
+ url: "https://pub.dartlang.org"
51
+ source: hosted
52
+ version: "3.0.6"
53
+ connectivity_for_web:
54
+ dependency: transitive
55
+ description:
56
+ name: connectivity_for_web
57
+ url: "https://pub.dartlang.org"
58
+ source: hosted
59
+ version: "0.4.0+1"
60
+ connectivity_macos:
61
+ dependency: transitive
62
+ description:
63
+ name: connectivity_macos
64
+ url: "https://pub.dartlang.org"
65
+ source: hosted
66
+ version: "0.2.1+2"
67
+ connectivity_platform_interface:
68
+ dependency: transitive
69
+ description:
70
+ name: connectivity_platform_interface
71
+ url: "https://pub.dartlang.org"
72
+ source: hosted
73
+ version: "2.0.1"
46
74
connectivity_wrapper:
47
75
dependency: "direct main"
48
76
description:
@@ -74,6 +102,18 @@ packages:
74
102
description: flutter
75
103
source: sdk
76
104
version: "0.0.0"
105
+ flutter_web_plugins:
106
+ dependency: transitive
107
+ description: flutter
108
+ source: sdk
109
+ version: "0.0.0"
110
+ js:
111
+ dependency: transitive
112
+ description:
113
+ name: js
114
+ url: "https://pub.dartlang.org"
115
+ source: hosted
116
+ version: "0.6.3"
77
117
matcher:
78
118
dependency: transitive
79
119
description:
@@ -102,6 +142,13 @@ packages:
102
142
url: "https://pub.dartlang.org"
103
143
source: hosted
104
144
version: "1.8.0"
145
+ plugin_platform_interface:
146
+ dependency: transitive
147
+ description:
148
+ name: plugin_platform_interface
149
+ url: "https://pub.dartlang.org"
150
+ source: hosted
151
+ version: "2.0.2"
105
152
provider:
106
153
dependency: transitive
107
154
description:
@@ -172,4 +219,4 @@ packages:
172
219
version: "2.1.0"
173
220
sdks:
174
221
dart: ">=2.12.0 <3.0.0"
175
- flutter: ">=1.16 .0"
222
+ flutter: ">=1.20 .0"
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ import 'dart:io';
16
16
17
17
// Project imports:
18
18
import 'package:connectivity_wrapper/src/utils/constants.dart' ;
19
+ import 'package:flutter/foundation.dart' ;
20
+ import 'package:connectivity/connectivity.dart' ;
19
21
20
22
export 'package:connectivity_wrapper/src/widgets/connectivity_app_wrapper_widget.dart' ;
21
23
export 'package:connectivity_wrapper/src/widgets/connectivity_screen_wrapper.dart' ;
@@ -83,6 +85,7 @@ class ConnectivityWrapper {
83
85
List <AddressCheckResult > _lastTryResults = < AddressCheckResult > [];
84
86
85
87
Future <bool > get isConnected async {
88
+ if (kIsWeb) return await _checkWebConnection ();
86
89
List <Future <AddressCheckResult >> requests = [];
87
90
88
91
for (var addressOptions in addresses) {
@@ -99,6 +102,16 @@ class ConnectivityWrapper {
99
102
: ConnectivityStatus .DISCONNECTED ;
100
103
}
101
104
105
+ ///
106
+ Future <bool > _checkWebConnection () async {
107
+ var connectivityResult = await (Connectivity ().checkConnectivity ());
108
+ if (connectivityResult == ConnectivityResult .mobile ||
109
+ connectivityResult == ConnectivityResult .wifi) {
110
+ return true ;
111
+ }
112
+ return false ;
113
+ }
114
+
102
115
Duration checkInterval = DEFAULT_INTERVAL ;
103
116
104
117
_maybeEmitStatusUpdate ([Timer ? timer]) async {
Original file line number Diff line number Diff line change @@ -50,6 +50,34 @@ packages:
50
50
url: "https://pub.dartlang.org"
51
51
source: hosted
52
52
version: "1.15.0"
53
+ connectivity:
54
+ dependency: "direct main"
55
+ description:
56
+ name: connectivity
57
+ url: "https://pub.dartlang.org"
58
+ source: hosted
59
+ version: "3.0.6"
60
+ connectivity_for_web:
61
+ dependency: transitive
62
+ description:
63
+ name: connectivity_for_web
64
+ url: "https://pub.dartlang.org"
65
+ source: hosted
66
+ version: "0.4.0+1"
67
+ connectivity_macos:
68
+ dependency: transitive
69
+ description:
70
+ name: connectivity_macos
71
+ url: "https://pub.dartlang.org"
72
+ source: hosted
73
+ version: "0.2.1+2"
74
+ connectivity_platform_interface:
75
+ dependency: transitive
76
+ description:
77
+ name: connectivity_platform_interface
78
+ url: "https://pub.dartlang.org"
79
+ source: hosted
80
+ version: "2.0.1"
53
81
fake_async:
54
82
dependency: transitive
55
83
description:
@@ -67,13 +95,25 @@ packages:
67
95
description: flutter
68
96
source: sdk
69
97
version: "0.0.0"
98
+ flutter_web_plugins:
99
+ dependency: transitive
100
+ description: flutter
101
+ source: sdk
102
+ version: "0.0.0"
70
103
import_sorter:
71
104
dependency: "direct dev"
72
105
description:
73
106
name: import_sorter
74
107
url: "https://pub.dartlang.org"
75
108
source: hosted
76
109
version: "4.5.0"
110
+ js:
111
+ dependency: transitive
112
+ description:
113
+ name: js
114
+ url: "https://pub.dartlang.org"
115
+ source: hosted
116
+ version: "0.6.3"
77
117
matcher:
78
118
dependency: transitive
79
119
description:
@@ -102,6 +142,13 @@ packages:
102
142
url: "https://pub.dartlang.org"
103
143
source: hosted
104
144
version: "1.8.0"
145
+ plugin_platform_interface:
146
+ dependency: transitive
147
+ description:
148
+ name: plugin_platform_interface
149
+ url: "https://pub.dartlang.org"
150
+ source: hosted
151
+ version: "2.0.2"
105
152
provider:
106
153
dependency: "direct main"
107
154
description:
@@ -186,4 +233,4 @@ packages:
186
233
version: "3.1.0"
187
234
sdks:
188
235
dart: ">=2.12.0 <3.0.0"
189
- flutter: ">=1.16 .0"
236
+ flutter: ">=1.20 .0"
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ dependencies:
11
11
flutter :
12
12
sdk : flutter
13
13
provider : ^5.0.0
14
+ connectivity : ^3.0.6 # To check connectivity for web only
15
+
14
16
15
17
dev_dependencies :
16
18
flutter_test :
You can’t perform that action at this time.
0 commit comments