File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -225,16 +225,22 @@ bool canUseCachedTranslation({
225225
226226Future <bool > _isConnectionTypeAllowed (
227227 InternetConnectionType connectionType) async {
228- var connectionStatus = await Connectivity ().checkConnectivity ();
228+ var connectionResult = await Connectivity ().checkConnectivity ();
229+ //ignore: unnecessary_type_check
230+ final List <ConnectivityResult > connectionStatus = connectionResult is Iterable
231+ ? [...connectionResult as Iterable ]
232+ //ignore: unnecessary_cast
233+ : [connectionResult as ConnectivityResult ];
234+
229235 switch (connectionType) {
230236 case InternetConnectionType .any:
231- return connectionStatus != ConnectivityResult .none;
237+ return ! connectionStatus. contains ( ConnectivityResult .none) ;
232238 case InternetConnectionType .wifi:
233- return connectionStatus == ConnectivityResult .wifi;
239+ return connectionStatus. contains ( ConnectivityResult .wifi) ;
234240 case InternetConnectionType .mobileData:
235- return connectionStatus == ConnectivityResult .mobile;
241+ return connectionStatus. contains ( ConnectivityResult .mobile) ;
236242 case InternetConnectionType .ethernet:
237- return connectionStatus == ConnectivityResult .ethernet;
243+ return connectionStatus. contains ( ConnectivityResult .ethernet) ;
238244 }
239245}
240246
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ dependencies:
2020 path : ^1.8.1
2121 oauth2 : ^2.0.1
2222 url_launcher : ^6.1.0
23- app_links : ' >=3.4.2'
23+ app_links : ' >=3.4.2 <7.0.0 '
2424 web_socket_channel : ' >=2.2.0 <4.0.0'
2525
2626 flutter_localizations :
You can’t perform that action at this time.
0 commit comments