Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Raslan/update connectivity_plus lib #359

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/state/connection/connection_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ConnectionCubit extends Cubit<ConnectionState> {
static String get appId => _connectionInformation.appId;

/// Stream subscription for connectivity.
StreamSubscription<ConnectivityResult>? _connectivitySubscription;
StreamSubscription<List<ConnectivityResult>>? _connectivitySubscription;

/// Getter for [BaseAPI] implementation class. By default, it will be [BinaryAPI].
BaseAPI get api => _api;
Expand Down Expand Up @@ -123,9 +123,11 @@ class ConnectionCubit extends Cubit<ConnectionState> {

void _setupConnectivityListener() {
_connectivitySubscription ??= Connectivity().onConnectivityChanged.listen(
(ConnectivityResult status) async {
if (status == ConnectivityResult.none) {
emit(const ConnectionDisconnectedState());
(List<ConnectivityResult> results) async {
for (final ConnectivityResult status in results) {
if (status == ConnectivityResult.none) {
emit(const ConnectionDisconnectedState());
}
}
},
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:
url: https://github.com/BrowserStackCE/flutter_system_proxy.git
ref: v0.1.5
package_info_plus: ^8.0.2
connectivity_plus: ^5.0.2
connectivity_plus: ^6.1.1
web_socket_channel: ^3.0.1
device_info_plus: ^10.1.2

Expand Down
Loading