From 0c03688892684a1bb954e68603b01848591f0872 Mon Sep 17 00:00:00 2001 From: George Kutsurua Date: Tue, 20 Feb 2024 22:43:19 +0400 Subject: [PATCH] feat(connectivity)!: support multiple ConnectivityResult values at the same time BREAKING CHANGES: checkConnectivity and onConnectivityChanged returns list of connectivityResult. Users will need to update their apps to handle the new list of ConnectivityResult types returned by checkConnectivity and onConnectivityChanged methods. Signed-off-by: George Kutsurua --- .../example/pubspec_overrides.yaml | 4 +++ .../example/pubspec_overrides.yaml | 4 +++ .../example/pubspec_overrides.yaml | 6 ++++ .../battery_plus/pubspec_overrides.yaml | 4 +++ .../gradle/wrapper/gradle-wrapper.properties | 5 ++-- .../plus/connectivity/Connectivity.java | 14 ++++++--- .../ConnectivityBroadcastReceiver.java | 4 +-- .../ConnectivityMethodChannelHandler.java | 2 +- .../ios/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- .../example/pubspec_overrides.yaml | 6 ++++ .../PathMonitorConnectivityProvider.swift | 12 ++++---- .../ReachabilityConnectivityProvider.swift | 19 ++++++------ .../Classes/SwiftConnectivityPlusPlugin.swift | 4 +-- .../macos/Classes/ConnectivityPlugin.swift | 4 +-- .../PathMonitorConnectivityProvider.swift | 12 ++++---- .../ReachabilityConnectivityProvider.swift | 18 +++++------ .../connectivity_plus/pubspec_overrides.yaml | 4 +++ .../windows/connectivity_plus_plugin.cpp | 30 +++++++++---------- .../lib/method_channel_connectivity.dart | 6 ++-- .../lib/src/utils.dart | 4 +-- .../example/pubspec_overrides.yaml | 6 ++++ .../device_info_plus/pubspec_overrides.yaml | 4 +++ .../example/pubspec_overrides.yaml | 6 ++++ .../network_info_plus/pubspec_overrides.yaml | 4 +++ .../example/pubspec_overrides.yaml | 6 ++++ .../package_info_plus/pubspec_overrides.yaml | 4 +++ .../example/pubspec_overrides.yaml | 6 ++++ .../sensors_plus/pubspec_overrides.yaml | 4 +++ .../share_plus/example/pubspec_overrides.yaml | 6 ++++ .../share_plus/pubspec_overrides.yaml | 4 +++ 31 files changed, 150 insertions(+), 66 deletions(-) create mode 100644 packages/android_alarm_manager_plus/example/pubspec_overrides.yaml create mode 100644 packages/android_intent_plus/example/pubspec_overrides.yaml create mode 100644 packages/battery_plus/battery_plus/example/pubspec_overrides.yaml create mode 100644 packages/battery_plus/battery_plus/pubspec_overrides.yaml create mode 100644 packages/connectivity_plus/connectivity_plus/example/pubspec_overrides.yaml create mode 100644 packages/connectivity_plus/connectivity_plus/pubspec_overrides.yaml create mode 100644 packages/device_info_plus/device_info_plus/example/pubspec_overrides.yaml create mode 100644 packages/device_info_plus/device_info_plus/pubspec_overrides.yaml create mode 100644 packages/network_info_plus/network_info_plus/example/pubspec_overrides.yaml create mode 100644 packages/network_info_plus/network_info_plus/pubspec_overrides.yaml create mode 100644 packages/package_info_plus/package_info_plus/example/pubspec_overrides.yaml create mode 100644 packages/package_info_plus/package_info_plus/pubspec_overrides.yaml create mode 100644 packages/sensors_plus/sensors_plus/example/pubspec_overrides.yaml create mode 100644 packages/sensors_plus/sensors_plus/pubspec_overrides.yaml create mode 100644 packages/share_plus/share_plus/example/pubspec_overrides.yaml create mode 100644 packages/share_plus/share_plus/pubspec_overrides.yaml diff --git a/packages/android_alarm_manager_plus/example/pubspec_overrides.yaml b/packages/android_alarm_manager_plus/example/pubspec_overrides.yaml new file mode 100644 index 00000000000..0933d821243 --- /dev/null +++ b/packages/android_alarm_manager_plus/example/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: android_alarm_manager_plus +dependency_overrides: + android_alarm_manager_plus: + path: .. diff --git a/packages/android_intent_plus/example/pubspec_overrides.yaml b/packages/android_intent_plus/example/pubspec_overrides.yaml new file mode 100644 index 00000000000..6132e38e749 --- /dev/null +++ b/packages/android_intent_plus/example/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: android_intent_plus +dependency_overrides: + android_intent_plus: + path: .. diff --git a/packages/battery_plus/battery_plus/example/pubspec_overrides.yaml b/packages/battery_plus/battery_plus/example/pubspec_overrides.yaml new file mode 100644 index 00000000000..af4c05f75c8 --- /dev/null +++ b/packages/battery_plus/battery_plus/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: battery_plus,battery_plus_platform_interface +dependency_overrides: + battery_plus: + path: .. + battery_plus_platform_interface: + path: ../../battery_plus_platform_interface diff --git a/packages/battery_plus/battery_plus/pubspec_overrides.yaml b/packages/battery_plus/battery_plus/pubspec_overrides.yaml new file mode 100644 index 00000000000..2ee770dc775 --- /dev/null +++ b/packages/battery_plus/battery_plus/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: battery_plus_platform_interface +dependency_overrides: + battery_plus_platform_interface: + path: ../battery_plus_platform_interface diff --git a/packages/connectivity_plus/connectivity_plus/android/gradle/wrapper/gradle-wrapper.properties b/packages/connectivity_plus/connectivity_plus/android/gradle/wrapper/gradle-wrapper.properties index 62dbe3c1308..681c1b40ad3 100644 --- a/packages/connectivity_plus/connectivity_plus/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/connectivity_plus/connectivity_plus/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Tue Feb 20 19:54:18 GST 2024 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/Connectivity.java b/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/Connectivity.java index 33886de59bc..3942342ced5 100644 --- a/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/Connectivity.java +++ b/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/Connectivity.java @@ -19,6 +19,7 @@ public class Connectivity { static final String CONNECTIVITY_ETHERNET = "ethernet"; static final String CONNECTIVITY_BLUETOOTH = "bluetooth"; static final String CONNECTIVITY_VPN = "vpn"; + static final String CONNECTIVITY_OTHER = "other"; private final ConnectivityManager connectivityManager; public Connectivity(ConnectivityManager connectivityManager) { @@ -30,11 +31,13 @@ List getNetworkTypes() { if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Network network = connectivityManager.getActiveNetwork(); NetworkCapabilities capabilities = connectivityManager.getNetworkCapabilities(network); - if (capabilities == null) { + if (capabilities == null + || !capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)) { types.add(CONNECTIVITY_NONE); return types; } - if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) { + if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) + || capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI_AWARE)) { types.add(CONNECTIVITY_WIFI); } if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET)) { @@ -49,9 +52,12 @@ List getNetworkTypes() { if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_BLUETOOTH)) { types.add(CONNECTIVITY_BLUETOOTH); } + if (types.isEmpty() + && capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)) { + types.add(CONNECTIVITY_OTHER); + } if (types.isEmpty()) { types.add(CONNECTIVITY_NONE); - return types; } } else { // For legacy versions, return a single type as before or adapt similarly if multiple types need to be supported @@ -91,7 +97,7 @@ private List getNetworkTypesLegacy() { types.add(CONNECTIVITY_MOBILE); break; default: - types.add(CONNECTIVITY_NONE); + types.add(CONNECTIVITY_OTHER); } return types; } diff --git a/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/ConnectivityBroadcastReceiver.java b/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/ConnectivityBroadcastReceiver.java index 2380b440421..aa334e50475 100644 --- a/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/ConnectivityBroadcastReceiver.java +++ b/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/ConnectivityBroadcastReceiver.java @@ -78,12 +78,12 @@ public void onCancel(Object arguments) { @Override public void onReceive(Context context, Intent intent) { if (events != null) { - events.success(String.join(",", connectivity.getNetworkTypes())); + events.success(connectivity.getNetworkTypes()); } } private void sendEvent() { - Runnable runnable = () -> events.success(String.join(",", connectivity.getNetworkTypes())); + Runnable runnable = () -> events.success(connectivity.getNetworkTypes()); mainHandler.post(runnable); } diff --git a/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/ConnectivityMethodChannelHandler.java b/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/ConnectivityMethodChannelHandler.java index 8c6e394e4a6..e6cfbf1c2f1 100644 --- a/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/ConnectivityMethodChannelHandler.java +++ b/packages/connectivity_plus/connectivity_plus/android/src/main/java/dev/fluttercommunity/plus/connectivity/ConnectivityMethodChannelHandler.java @@ -29,7 +29,7 @@ class ConnectivityMethodChannelHandler implements MethodChannel.MethodCallHandle @Override public void onMethodCall(MethodCall call, @NonNull MethodChannel.Result result) { if ("check".equals(call.method)) { - result.success(String.join(",", connectivity.getNetworkTypes())); + result.success(connectivity.getNetworkTypes()); } else { result.notImplemented(); } diff --git a/packages/connectivity_plus/connectivity_plus/example/ios/Runner.xcodeproj/project.pbxproj b/packages/connectivity_plus/connectivity_plus/example/ios/Runner.xcodeproj/project.pbxproj index 922e2dea2e1..e65736f1f9d 100644 --- a/packages/connectivity_plus/connectivity_plus/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/connectivity_plus/connectivity_plus/example/ios/Runner.xcodeproj/project.pbxproj @@ -214,7 +214,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { diff --git a/packages/connectivity_plus/connectivity_plus/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/connectivity_plus/connectivity_plus/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 87131a09bea..8e3ca5dfe19 100644 --- a/packages/connectivity_plus/connectivity_plus/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/connectivity_plus/connectivity_plus/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ NWPathMonitor { - if (_pathMonitor == nil) { + if (pathMonitor == nil) { let pathMonitor = NWPathMonitor() pathMonitor.start(queue: queue) pathMonitor.pathUpdateHandler = pathUpdateHandler - _pathMonitor = pathMonitor + self.pathMonitor = pathMonitor } - return _pathMonitor! + return self.pathMonitor! } private func pathUpdateHandler(path: NWPath) { diff --git a/packages/connectivity_plus/connectivity_plus/ios/Classes/ReachabilityConnectivityProvider.swift b/packages/connectivity_plus/connectivity_plus/ios/Classes/ReachabilityConnectivityProvider.swift index a3ca5427ab7..929b849cbf8 100644 --- a/packages/connectivity_plus/connectivity_plus/ios/Classes/ReachabilityConnectivityProvider.swift +++ b/packages/connectivity_plus/connectivity_plus/ios/Classes/ReachabilityConnectivityProvider.swift @@ -2,13 +2,14 @@ import Foundation import Reachability public class ReachabilityConnectivityProvider: NSObject, ConnectivityProvider { - private var _reachability: Reachability? + private var reachability: Reachability? public var currentConnectivityTypes: [ConnectivityType] { - guard let reachability = _reachability else { + guard let reachability = reachability else { return [.none] } + // Supported types https://github.com/ashleymills/Reachability.swift/blob/master/Sources/Reachability.swift#L99 switch reachability.connection { case .wifi: return [.wifi] @@ -42,23 +43,23 @@ public class ReachabilityConnectivityProvider: NSObject, ConnectivityProvider { NotificationCenter.default.removeObserver( self, name: .reachabilityChanged, - object: _reachability) + object: reachability) - _reachability?.stopNotifier() - _reachability = nil + reachability?.stopNotifier() + reachability = nil } private func ensureReachability() -> Reachability { - if (_reachability == nil) { + if (reachability == nil) { let reachability = try? Reachability() - _reachability = reachability + self.reachability = reachability } - return _reachability! + return reachability! } @objc private func reachabilityChanged(notification: NSNotification) { if let reachability = notification.object as? Reachability { - _reachability = reachability + self.reachability = reachability connectivityUpdateHandler?(currentConnectivityTypes) } } diff --git a/packages/connectivity_plus/connectivity_plus/ios/Classes/SwiftConnectivityPlusPlugin.swift b/packages/connectivity_plus/connectivity_plus/ios/Classes/SwiftConnectivityPlusPlugin.swift index 0b93aedca25..105c752317b 100644 --- a/packages/connectivity_plus/connectivity_plus/ios/Classes/SwiftConnectivityPlusPlugin.swift +++ b/packages/connectivity_plus/connectivity_plus/ios/Classes/SwiftConnectivityPlusPlugin.swift @@ -65,10 +65,10 @@ public class SwiftConnectivityPlusPlugin: NSObject, FlutterPlugin, FlutterStream } } - private func statusFrom(connectivityTypes: [ConnectivityType]) -> String { + private func statusFrom(connectivityTypes: [ConnectivityType]) -> [String] { return connectivityTypes.map { self.statusFrom(connectivityType: $0) - }.joined(separator: ",") + } } public func onListen( diff --git a/packages/connectivity_plus/connectivity_plus/macos/Classes/ConnectivityPlugin.swift b/packages/connectivity_plus/connectivity_plus/macos/Classes/ConnectivityPlugin.swift index 0e4fd0dd72f..b9035e52e9a 100644 --- a/packages/connectivity_plus/connectivity_plus/macos/Classes/ConnectivityPlugin.swift +++ b/packages/connectivity_plus/connectivity_plus/macos/Classes/ConnectivityPlugin.swift @@ -66,10 +66,10 @@ public class ConnectivityPlugin: NSObject, FlutterPlugin, FlutterStreamHandler { } } - private func statusFrom(connectivityTypes: [ConnectivityType]) -> String { + private func statusFrom(connectivityTypes: [ConnectivityType]) -> [String] { return connectivityTypes.map { self.statusFrom(connectivityType: $0) - }.joined(separator: ",") + } } public func onListen( diff --git a/packages/connectivity_plus/connectivity_plus/macos/Classes/PathMonitorConnectivityProvider.swift b/packages/connectivity_plus/connectivity_plus/macos/Classes/PathMonitorConnectivityProvider.swift index d15b8d487ab..cc9d9ec1a62 100644 --- a/packages/connectivity_plus/connectivity_plus/macos/Classes/PathMonitorConnectivityProvider.swift +++ b/packages/connectivity_plus/connectivity_plus/macos/Classes/PathMonitorConnectivityProvider.swift @@ -6,7 +6,7 @@ public class PathMonitorConnectivityProvider: NSObject, ConnectivityProvider { private let queue = DispatchQueue.global(qos: .background) - private var _pathMonitor: NWPathMonitor? + private var pathMonitor: NWPathMonitor? public var currentConnectivityTypes: [ConnectivityType] { let path = ensurePathMonitor().currentPath @@ -43,18 +43,18 @@ public class PathMonitorConnectivityProvider: NSObject, ConnectivityProvider { } public func stop() { - _pathMonitor?.cancel() - _pathMonitor = nil + pathMonitor?.cancel() + pathMonitor = nil } private func ensurePathMonitor() -> NWPathMonitor { - if (_pathMonitor == nil) { + if (pathMonitor == nil) { let pathMonitor = NWPathMonitor() pathMonitor.start(queue: queue) pathMonitor.pathUpdateHandler = pathUpdateHandler - _pathMonitor = pathMonitor + self.pathMonitor = pathMonitor } - return _pathMonitor! + return self.pathMonitor! } private func pathUpdateHandler(path: NWPath) { diff --git a/packages/connectivity_plus/connectivity_plus/macos/Classes/ReachabilityConnectivityProvider.swift b/packages/connectivity_plus/connectivity_plus/macos/Classes/ReachabilityConnectivityProvider.swift index a3ca5427ab7..749132bcbc7 100644 --- a/packages/connectivity_plus/connectivity_plus/macos/Classes/ReachabilityConnectivityProvider.swift +++ b/packages/connectivity_plus/connectivity_plus/macos/Classes/ReachabilityConnectivityProvider.swift @@ -2,10 +2,10 @@ import Foundation import Reachability public class ReachabilityConnectivityProvider: NSObject, ConnectivityProvider { - private var _reachability: Reachability? + private var reachability: Reachability? public var currentConnectivityTypes: [ConnectivityType] { - guard let reachability = _reachability else { + guard let reachability = reachability else { return [.none] } @@ -42,23 +42,23 @@ public class ReachabilityConnectivityProvider: NSObject, ConnectivityProvider { NotificationCenter.default.removeObserver( self, name: .reachabilityChanged, - object: _reachability) + object: reachability) - _reachability?.stopNotifier() - _reachability = nil + reachability?.stopNotifier() + reachability = nil } private func ensureReachability() -> Reachability { - if (_reachability == nil) { + if (reachability == nil) { let reachability = try? Reachability() - _reachability = reachability + self.reachability = reachability } - return _reachability! + return self.reachability! } @objc private func reachabilityChanged(notification: NSNotification) { if let reachability = notification.object as? Reachability { - _reachability = reachability + self.reachability = reachability connectivityUpdateHandler?(currentConnectivityTypes) } } diff --git a/packages/connectivity_plus/connectivity_plus/pubspec_overrides.yaml b/packages/connectivity_plus/connectivity_plus/pubspec_overrides.yaml new file mode 100644 index 00000000000..b23d0777b26 --- /dev/null +++ b/packages/connectivity_plus/connectivity_plus/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: connectivity_plus_platform_interface +dependency_overrides: + connectivity_plus_platform_interface: + path: ../connectivity_plus_platform_interface diff --git a/packages/connectivity_plus/connectivity_plus/windows/connectivity_plus_plugin.cpp b/packages/connectivity_plus/connectivity_plus/windows/connectivity_plus_plugin.cpp index 9b47c491c7c..cb6ae1f936f 100644 --- a/packages/connectivity_plus/connectivity_plus/windows/connectivity_plus_plugin.cpp +++ b/packages/connectivity_plus/connectivity_plus/windows/connectivity_plus_plugin.cpp @@ -114,29 +114,29 @@ static std::string ConnectivityToString(ConnectivityType connectivityType) { } } -static std::string -ConnectivityToString(std::set connectivityTypes) { +static flutter::EncodableList +EncodeConnectivityTypes(std::set connectivityTypes) { + flutter::EncodableList encodedList; + if (connectivityTypes.empty()) { - return "none"; + encodedList.push_back( + flutter::EncodableValue(ConnectivityToString(ConnectivityType::None))); + return encodedList; } - std::string connectivity; - for (auto type : connectivityTypes) { - if (!connectivity.empty()) { - connectivity += ','; - } - connectivity += ConnectivityToString(type); + for (const auto &type : connectivityTypes) { + std::string connectivityString = ConnectivityToString(type); + encodedList.push_back(flutter::EncodableValue(connectivityString)); } - return connectivity; + + return encodedList; } void ConnectivityPlusWindowsPlugin::HandleMethodCall( const flutter::MethodCall &method_call, std::unique_ptr> result) { if (method_call.method_name().compare("check") == 0) { - std::string connectivity = - ConnectivityToString(manager->GetConnectivityTypes()); - result->Success(flutter::EncodableValue(connectivity)); + result->Success(EncodeConnectivityTypes(manager->GetConnectivityTypes())); } else { result->NotImplemented(); } @@ -149,9 +149,7 @@ ConnectivityStreamHandler::ConnectivityStreamHandler( ConnectivityStreamHandler::~ConnectivityStreamHandler() {} void ConnectivityStreamHandler::AddConnectivityEvent() { - std::string connectivity = - ConnectivityToString(manager->GetConnectivityTypes()); - sink->Success(flutter::EncodableValue(connectivity)); + sink->Success(EncodeConnectivityTypes(manager->GetConnectivityTypes())); } std::unique_ptr diff --git a/packages/connectivity_plus/connectivity_plus_platform_interface/lib/method_channel_connectivity.dart b/packages/connectivity_plus/connectivity_plus_platform_interface/lib/method_channel_connectivity.dart index 5fa96e8eb94..95dcea4e50b 100644 --- a/packages/connectivity_plus/connectivity_plus_platform_interface/lib/method_channel_connectivity.dart +++ b/packages/connectivity_plus/connectivity_plus_platform_interface/lib/method_channel_connectivity.dart @@ -29,7 +29,7 @@ class MethodChannelConnectivity extends ConnectivityPlatform { Stream> get onConnectivityChanged { _onConnectivityChanged ??= eventChannel .receiveBroadcastStream() - .map((dynamic result) => result.toString()) + .map((dynamic result) => List.from(result)) .map(parseConnectivityResults); return _onConnectivityChanged!; } @@ -37,7 +37,7 @@ class MethodChannelConnectivity extends ConnectivityPlatform { @override Future> checkConnectivity() { return methodChannel - .invokeMethod('check') - .then((value) => parseConnectivityResults(value ?? '')); + .invokeListMethod('check') + .then((value) => parseConnectivityResults(value ?? [])); } } diff --git a/packages/connectivity_plus/connectivity_plus_platform_interface/lib/src/utils.dart b/packages/connectivity_plus/connectivity_plus_platform_interface/lib/src/utils.dart index 026faf09282..019a49a3aab 100644 --- a/packages/connectivity_plus/connectivity_plus_platform_interface/lib/src/utils.dart +++ b/packages/connectivity_plus/connectivity_plus_platform_interface/lib/src/utils.dart @@ -1,8 +1,8 @@ import 'package:connectivity_plus_platform_interface/connectivity_plus_platform_interface.dart'; /// Convert a comma-separated String to a list of ConnectivityResult values. -List parseConnectivityResults(String states) { - return states.split(',').map((state) { +List parseConnectivityResults(List states) { + return states.map((state) { switch (state.trim()) { case 'bluetooth': return ConnectivityResult.bluetooth; diff --git a/packages/device_info_plus/device_info_plus/example/pubspec_overrides.yaml b/packages/device_info_plus/device_info_plus/example/pubspec_overrides.yaml new file mode 100644 index 00000000000..8d456b6dfa0 --- /dev/null +++ b/packages/device_info_plus/device_info_plus/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: device_info_plus,device_info_plus_platform_interface +dependency_overrides: + device_info_plus: + path: .. + device_info_plus_platform_interface: + path: ../../device_info_plus_platform_interface diff --git a/packages/device_info_plus/device_info_plus/pubspec_overrides.yaml b/packages/device_info_plus/device_info_plus/pubspec_overrides.yaml new file mode 100644 index 00000000000..9447fa40d8f --- /dev/null +++ b/packages/device_info_plus/device_info_plus/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: device_info_plus_platform_interface +dependency_overrides: + device_info_plus_platform_interface: + path: ../device_info_plus_platform_interface diff --git a/packages/network_info_plus/network_info_plus/example/pubspec_overrides.yaml b/packages/network_info_plus/network_info_plus/example/pubspec_overrides.yaml new file mode 100644 index 00000000000..aae57d5774d --- /dev/null +++ b/packages/network_info_plus/network_info_plus/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: network_info_plus,network_info_plus_platform_interface +dependency_overrides: + network_info_plus: + path: .. + network_info_plus_platform_interface: + path: ../../network_info_plus_platform_interface diff --git a/packages/network_info_plus/network_info_plus/pubspec_overrides.yaml b/packages/network_info_plus/network_info_plus/pubspec_overrides.yaml new file mode 100644 index 00000000000..8926d3f4cf3 --- /dev/null +++ b/packages/network_info_plus/network_info_plus/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: network_info_plus_platform_interface +dependency_overrides: + network_info_plus_platform_interface: + path: ../network_info_plus_platform_interface diff --git a/packages/package_info_plus/package_info_plus/example/pubspec_overrides.yaml b/packages/package_info_plus/package_info_plus/example/pubspec_overrides.yaml new file mode 100644 index 00000000000..b3704eee782 --- /dev/null +++ b/packages/package_info_plus/package_info_plus/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: package_info_plus,package_info_plus_platform_interface +dependency_overrides: + package_info_plus: + path: .. + package_info_plus_platform_interface: + path: ../../package_info_plus_platform_interface diff --git a/packages/package_info_plus/package_info_plus/pubspec_overrides.yaml b/packages/package_info_plus/package_info_plus/pubspec_overrides.yaml new file mode 100644 index 00000000000..aed6d8b742f --- /dev/null +++ b/packages/package_info_plus/package_info_plus/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: package_info_plus_platform_interface +dependency_overrides: + package_info_plus_platform_interface: + path: ../package_info_plus_platform_interface diff --git a/packages/sensors_plus/sensors_plus/example/pubspec_overrides.yaml b/packages/sensors_plus/sensors_plus/example/pubspec_overrides.yaml new file mode 100644 index 00000000000..468c94623e5 --- /dev/null +++ b/packages/sensors_plus/sensors_plus/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: sensors_plus,sensors_plus_platform_interface +dependency_overrides: + sensors_plus: + path: .. + sensors_plus_platform_interface: + path: ../../sensors_plus_platform_interface diff --git a/packages/sensors_plus/sensors_plus/pubspec_overrides.yaml b/packages/sensors_plus/sensors_plus/pubspec_overrides.yaml new file mode 100644 index 00000000000..0ec8e630505 --- /dev/null +++ b/packages/sensors_plus/sensors_plus/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: sensors_plus_platform_interface +dependency_overrides: + sensors_plus_platform_interface: + path: ../sensors_plus_platform_interface diff --git a/packages/share_plus/share_plus/example/pubspec_overrides.yaml b/packages/share_plus/share_plus/example/pubspec_overrides.yaml new file mode 100644 index 00000000000..29e0f92a8ad --- /dev/null +++ b/packages/share_plus/share_plus/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: share_plus,share_plus_platform_interface +dependency_overrides: + share_plus: + path: .. + share_plus_platform_interface: + path: ../../share_plus_platform_interface diff --git a/packages/share_plus/share_plus/pubspec_overrides.yaml b/packages/share_plus/share_plus/pubspec_overrides.yaml new file mode 100644 index 00000000000..0ed0d5afb54 --- /dev/null +++ b/packages/share_plus/share_plus/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: share_plus_platform_interface +dependency_overrides: + share_plus_platform_interface: + path: ../share_plus_platform_interface