Skip to content

Commit

Permalink
Merge pull request #8 from MAlazhariy/versions/v1.6.0
Browse files Browse the repository at this point in the history
v1.6.0
  • Loading branch information
MAlazhariy authored Oct 7, 2024
2 parents 98b00d4 + dcfe9c3 commit c3bb059
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.6.0]

### Added
- Change `checkConnection` return type to `Future<bool>` to return if connection is available or not.

---

## [1.5.0]

### Enhanced
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Add the package to your `pubspec.yaml` under `dependencies:`:
internet_state_manager:
git:
url: https://github.com/MAlazhariy/internet_state_manager.git
ref: v1.5.0
ref: v1.6.0
```
#### Android Configuration
Expand Down
6 changes: 4 additions & 2 deletions lib/src/bloc/internet_manager_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class InternetManagerCubit extends Cubit<InternetManagerState> {
});
}

Future<void> checkConnection() async {
if (_loading) return;
Future<bool> checkConnection() async {
if (_loading) return state.status.isConnected;
_timer?.cancel();
_connectionChanged = false;
_loading = true;
Expand Down Expand Up @@ -96,6 +96,8 @@ class InternetManagerCubit extends Cubit<InternetManagerState> {
if (getOptions.autoCheckConnection || !connectionResult) {
_startTimer();
}

return connectionResult;
}

void _startTimer() {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A Flutter package for seamless internet connection management. Auto
author: MAlazhariy
homepage: https://github.com/MAlazhariy/internet_state_manager
issue_tracker: https://github.com/MAlazhariy/internet_state_manager/issues
version: 1.5.0
version: 1.6.0

environment:
sdk: '>=3.1.2 <4.0.0'
Expand Down

0 comments on commit c3bb059

Please sign in to comment.