File tree Expand file tree Collapse file tree 4 files changed +13
-9
lines changed
rust-lib/flowy-net/src/entities Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ class NetworkListener {
1111 late StreamSubscription <ConnectivityResult > _connectivitySubscription;
1212
1313 NetworkListener () {
14- _connectivitySubscription = _connectivity.onConnectivityChanged.listen (_updateConnectionStatus);
14+ _connectivitySubscription =
15+ _connectivity.onConnectivityChanged.listen (_updateConnectionStatus);
1516 }
1617
1718 Future <void > start () async {
@@ -39,9 +40,11 @@ class NetworkListener {
3940 return NetworkType .Ethernet ;
4041 case ConnectivityResult .mobile:
4142 return NetworkType .Cell ;
42- case ConnectivityResult .none:
43- return NetworkType .UnknownNetworkType ;
4443 case ConnectivityResult .bluetooth:
44+ return NetworkType .Bluetooth ;
45+ case ConnectivityResult .vpn:
46+ return NetworkType .VPN ;
47+ case ConnectivityResult .none:
4548 return NetworkType .UnknownNetworkType ;
4649 }
4750 }();
Original file line number Diff line number Diff line change @@ -212,12 +212,12 @@ packages:
212212 source: hosted
213213 version: "1.2.4"
214214 connectivity_plus_platform_interface:
215- dependency: transitive
215+ dependency: "direct main"
216216 description:
217217 name: connectivity_plus_platform_interface
218218 url: "https://pub.dartlang.org"
219219 source: hosted
220- version: "1.2.0 "
220+ version: "1.2.3 "
221221 connectivity_plus_web:
222222 dependency: transitive
223223 description:
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ dependencies:
6868 # file_picker: ^4.2.1
6969 clipboard : ^0.1.3
7070 connectivity_plus : ^2.3.6+1
71+ connectivity_plus_platform_interface : ^1.2.2
7172 easy_localization : ^3.0.0
7273 textfield_tags : ^2.0.0
7374 # The following adds the Cupertino Icons font to your application.
Original file line number Diff line number Diff line change @@ -6,15 +6,15 @@ pub enum NetworkType {
66 Wifi = 1 ,
77 Cell = 2 ,
88 Ethernet = 3 ,
9+ Bluetooth = 4 ,
10+ VPN = 5 ,
911}
1012
1113impl NetworkType {
1214 pub fn is_connect ( & self ) -> bool {
1315 match self {
14- NetworkType :: UnknownNetworkType => false ,
15- NetworkType :: Wifi => true ,
16- NetworkType :: Cell => true ,
17- NetworkType :: Ethernet => true ,
16+ NetworkType :: UnknownNetworkType | NetworkType :: Bluetooth => false ,
17+ NetworkType :: Wifi | NetworkType :: Cell | NetworkType :: Ethernet | NetworkType :: VPN => true ,
1818 }
1919 }
2020}
You can’t perform that action at this time.
0 commit comments