Skip to content

Commit

Permalink
bump dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Predidit committed Aug 27, 2024
1 parent 3fddeb3 commit a358e7b
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 133 deletions.
35 changes: 19 additions & 16 deletions lib/request/interceptor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,26 @@ class ApiInterceptor extends Interceptor {
}

static Future<String> checkConnect() async {
final ConnectivityResult connectivityResult =
final connectivityResult =
await Connectivity().checkConnectivity();
switch (connectivityResult) {
case ConnectivityResult.mobile:
return '正在使用移动流量';
case ConnectivityResult.wifi:
return '正在使用wifi';
case ConnectivityResult.ethernet:
return '正在使用局域网';
case ConnectivityResult.vpn:
return '正在使用代理网络';
case ConnectivityResult.other:
return '正在使用其他网络';
case ConnectivityResult.none:
return '未连接到任何网络';
default:
return '';
if (connectivityResult.contains(ConnectivityResult.mobile)) {
return '正在使用移动流量';
}
if (connectivityResult.contains(ConnectivityResult.wifi)) {
return '正在使用wifi';
}
if (connectivityResult.contains(ConnectivityResult.ethernet)) {
return '正在使用局域网';
}
if (connectivityResult.contains(ConnectivityResult.vpn)) {
return '正在使用代理网络';
}
if (connectivityResult.contains(ConnectivityResult.other)) {
return '正在使用其他网络';
}
if (connectivityResult.contains(ConnectivityResult.none)) {
return '未连接到任何网络';
}
return '';
}
}
2 changes: 1 addition & 1 deletion macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import wakelock_plus
import window_manager

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FlutterVolumeControllerPlugin.register(with: registry.registrar(forPlugin: "FlutterVolumeControllerPlugin"))
FvpPlugin.register(with: registry.registrar(forPlugin: "FvpPlugin"))
Expand Down
Loading

0 comments on commit a358e7b

Please sign in to comment.