Skip to content

Commit af6f028

Browse files
authored
v3.0.0 (#130)
* v3.0.0 * docs: update v3 availability note for clarity in README
1 parent dc47714 commit af6f028

5 files changed

Lines changed: 81 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 3.0.0
2+
3+
Please read the [v3 Migration Guide](MIGRATION_V3.md) for details on updating your project.
4+
5+
### Breaking Changes
6+
7+
- feat!: remove dependency on connectivity_plus in [c09b432](https://github.com/OutdatedGuy/internet_connection_checker_plus/commit/c09b432)
8+
9+
### Other Changes
10+
11+
- feat: update library to a Dart package in [4267811](https://github.com/OutdatedGuy/internet_connection_checker_plus/commit/4267811)
12+
- feat: update default endpoints to more robust ones in [78c54ab](https://github.com/OutdatedGuy/internet_connection_checker_plus/commit/78c54ab)
13+
- fix: 2nd and later listeners never get internet status in [2313d04](https://github.com/OutdatedGuy/internet_connection_checker_plus/commit/2313d04)
14+
- docs: revamp readme for cleaner documentation in [dc47714](https://github.com/OutdatedGuy/internet_connection_checker_plus/commit/dc47714)
15+
- chore: updated example app to Flutter v3.41.7 in [fd3c5e6](https://github.com/OutdatedGuy/internet_connection_checker_plus/commit/fd3c5e6)
16+
117
## 2.9.1+2
218

319
- docs: fix lifecycle changes code example in [222ef0b](https://github.com/OutdatedGuy/internet_connection_checker_plus/commit/222ef0b)
@@ -101,12 +117,10 @@
101117
## 1.0.0
102118

103119
- **BREAKING CHANGES**
104-
105120
- Using `http` requests instead of `Socket` connections.
106121
- Replaced `InternetAddress` with `Uri`.
107122

108123
- **NEW FEATURES**
109-
110124
- Added **_proper_** `Web` support.
111125
- Faster connection checks.
112126
- Reduced latency.

MIGRATION_V3.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Migration Guide: v2 to v3
2+
3+
This major release removed the dependency on the
4+
[`connectivity_plus`](https://pub.dev/packages/connectivity_plus) package,
5+
converting this library into a pure Dart package. If your application relied on
6+
hardware network connectivity changes to quickly trigger internet reachability
7+
checks, you must now pass a trigger stream explicitly.
8+
9+
## Breaking Changes
10+
11+
- Automatic listening to network hardware changes (e.g. Wi-Fi turning off) is no
12+
longer enabled by default since we no longer depend on `connectivity_plus`.
13+
14+
## Migration Steps
15+
16+
If you want to maintain the exact same behavior from `v2.x.x`, follow these
17+
steps:
18+
19+
### 1. Add `connectivity_plus` to your pubspec.yaml
20+
21+
Since it is no longer bundled with our package, you must install it directly.
22+
23+
```yaml
24+
dependencies:
25+
internet_connection_checker_plus: ^3.0.0
26+
connectivity_plus: ^7.0.0 # or latest
27+
```
28+
29+
### 2. Pass the trigger stream to `InternetConnection`
30+
31+
When you create or configure the internet connection, use the `createInstance`
32+
method and pass `Connectivity().onConnectivityChanged` to the new
33+
`triggerStream` parameter.
34+
35+
**Before (v2):**
36+
37+
```dart
38+
import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart';
39+
40+
final connection = InternetConnection();
41+
```
42+
43+
**After (v3):**
44+
45+
```dart
46+
import 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart';
47+
import 'package:connectivity_plus/connectivity_plus.dart';
48+
49+
final connection = InternetConnection.createInstance(
50+
triggerStream: Connectivity().onConnectivityChanged,
51+
);
52+
```
53+
54+
By providing a `triggerStream`, `InternetConnection` will instantly execute a
55+
ping reachability check whenever `connectivity_plus` emits an event, ensuring
56+
your users get the most accurate and real-time connectivity status.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ connectivity) but cannot guarantee actual internet reachability. This package
4141
proactively verifies external routing by checking reachability and response
4242
statuses against highly available global endpoints.
4343

44+
> [!NOTE]
45+
>
46+
> **🚀 v3 is now available!** It removes the `connectivity_plus` dependency to
47+
> make this a pure Dart package. Please read the
48+
> [v3 Migration Guide](MIGRATION_V3.md) to understand the breaking changes and
49+
> how to update your project.
50+
4451
## Features
4552

4653
- **Accurate Verification:** Verifies real internet access instead of local

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ packages:
129129
path: ".."
130130
relative: true
131131
source: path
132-
version: "2.9.1+2"
132+
version: "3.0.0"
133133
lints:
134134
dependency: transitive
135135
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: internet_connection_checker_plus
22
description: A pure Dart package to check your internet connection with subsecond response times, even on mobile networks!
3-
version: 2.9.1+2
3+
version: 3.0.0
44
homepage: https://outdatedguy.rocks
55
repository: https://github.com/OutdatedGuy/internet_connection_checker_plus
66
topics:

0 commit comments

Comments
 (0)