Skip to content

Commit

Permalink
v0.2.4+1 (#14)
Browse files Browse the repository at this point in the history
Fixes #13
  • Loading branch information
jogboms authored Feb 23, 2019
1 parent 0dcbc4f commit 3ebf57a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ dependencies:
flutter_offline: "^0.2.4"
```
#### Note for AndroidX Apps
Make sure to point to `0.2.4+1`

### ⚡️ Import

```dart
Expand Down
4 changes: 2 additions & 2 deletions lib/src/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ class OfflineBuilderState extends State<OfflineBuilder> {
) {
final child = widget.child ?? widget.builder(context);
if (!snapshot.hasData && !snapshot.hasError) {
return SizedBox();
return const SizedBox();
} else if (snapshot.hasError) {
if (widget.errorBuilder != null) {
return widget.errorBuilder(context);
}
throw new OfflineBuilderError(snapshot.error);
throw OfflineBuilderError(snapshot.error);
}
return widget.connectivityBuilder(context, snapshot.data, child);
},
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ packages:
name: connectivity
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1"
version: "0.4.2"
flutter:
dependency: "direct main"
description: flutter
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: flutter_offline
description: A tidy utility to handle offline/online connectivity like a Boss.
version: 0.2.4
version: 0.2.4+1
author: Jeremiah Ogbomo <[email protected]>
homepage: https://github.com/jogboms/flutter_offline

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.1.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
connectivity: ^0.3.1
connectivity: ^0.4.2

dev_dependencies:
flutter_test:
Expand Down
10 changes: 7 additions & 3 deletions test/flutter_offline_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,7 @@ class TestConnectivityService implements Connectivity {
controller.add(result);
}

void addError() {
controller.addError('Error');
}
void addError() => controller.addError('Error');

@override
Stream<ConnectivityResult> get onConnectivityChanged => controller.stream;
Expand All @@ -298,4 +296,10 @@ class TestConnectivityService implements Connectivity {
Future<ConnectivityResult> checkConnectivity() {
return Future.delayed(Duration.zero, () => initialConnection);
}

@override
Future<String> getWifiIP() async => '127.0.0.1';

@override
Future<String> getWifiName() async => 'Localhost';
}

0 comments on commit 3ebf57a

Please sign in to comment.