Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
Update 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Pinheiro committed Apr 10, 2021
1 parent 70c9473 commit 724d72a
Show file tree
Hide file tree
Showing 10 changed files with 203 additions and 111 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [1.0.2] - [04.10.2021]
### Features
- Added [on_toast_widget](https://pub.dev/packages/on_toast_widget) dependency to show custom and animated messages.
- Added `[showNoneUntilOnline]` and `[messageDurationWhenOnline]`

### Documentation
- Updated `README` documentation.

## [1.0.0] - [04.05.2021]
### Release

Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

`on_connectivity_widget` is a [Flutter](https://flutter.dev/) Package used to listen network states and show a custom message to application.

This Plugin uses [connectivity_plus](https://pub.dev/packages/connectivity_plus) as dependency to listen network states.
This Plugin uses [connectivity_plus](https://pub.dev/packages/connectivity_plus) as dependency to listen network states
and [on_toast_widget](https://pub.dev/packages/on_toast_widget) to show custom and animated messages.

## Help:

Expand Down Expand Up @@ -36,7 +37,7 @@ NOTE: Feel free to help with readme translations
Add the following code to your `pubspec.yaml`:
```yaml
dependencies:
on_connectivity_widget: ^1.0.0
on_connectivity_widget: ^1.0.2
```
## Some Features:
Expand All @@ -53,6 +54,7 @@ dependencies:
## TODO:
* Fix bugs.
* Add more default animations.
* Add more `[Features]`

## How to use:
Expand All @@ -70,8 +72,10 @@ All types of parameters on this plugin:
| `noneWidget` | `Widget?` | `Widget shown when network state is: Offline.` | <br>
| `animationDuration` | `Duration?` | `Used to define how long animation will last.` | <br>
| `messageDuration` | `Duration?` | `Used to define how long message will last.` | <br>
| `messageDurationWhenOnline` | `Duration?` | `Used to define how long message will after [showNoneUntilOnline].` | <br>
| `animationType` | `Curve?` | `Used to define what animation type will be shown.` | <br>
| `cancelInitState` | `bool?` | `Used to define if message will shown when application starts.` | <br>
| `showNoneUntilOnline` | `bool?` | `Used to define if message will await until network connect.` | <br>
| `customAnimation` | `Animation<Offset>?` | `Used if you want use your own animation.` | <br>
| `customPosition` | `Alignment?` | `Used if you want use your own position.` | <br>

Expand All @@ -82,26 +86,34 @@ All types of parameters on this plugin:
#### OnConnectivityWidget
```dart
OnConnectivityWidget(
animationDuration: Duration(seconds: 2),
messageDuration: Duration(seconds: 1),
animationDuration: Duration(seconds: 1),
messageDuration: Duration(seconds: 2),
position: PositionType.BOTTOM,
showNoneUntilOnline: true,
messageDurationWhenOnline: Duration(seconds: 2),
animationType: Curves.bounceInOut,
cancelInitState: true,
cancelInitState: false,
wifiWidget: Container(
color: Colors.green,
child: Text("Wifi"),
height: 60,
width: double.infinity,
color: Colors.green,
child: Center(child: Text("Wifi")),
),
mobileWidget: Container(
color: Colors.blue,
child: Text("Mobile"),
height: 60,
width: double.infinity,
color: Colors.blue,
child: Center(child: Text("Mobile")),
),
noneWidget: Container(
color: Colors.red,
child: Text("None"),
height: 60,
width: double.infinity,
color: Colors.red,
child: Center(child: Text("None")),
),
//customAnimation: null,
//customPosition: null,
);
),;
```

## LICENSE:
Expand Down
40 changes: 28 additions & 12 deletions README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

`on_connectivity_widget` é um [Flutter](https://flutter.dev/) Package usado para escultar os estados da internet e mostrar uma menssagem customizável para o aplicativo.

Esse Plugin usa [connectivity_plus](https://pub.dev/packages/connectivity_plus) como dependência para escultar os estados da internet.
Esse Plugin usa [connectivity_plus](https://pub.dev/packages/connectivity_plus) como dependência para escultar os estados da internet e usa [on_toast_widget](https://pub.dev/packages/on_toast_widget) para mostrar menssagem customizável e animada.

## Ajuda:

Expand Down Expand Up @@ -36,9 +36,15 @@ NOTE: Fique à vontade para ajudar nas traduções
Adicione o seguinte codigo para seu `pubspec.yaml`:
```yaml
dependencies:
on_connectivity_widget: ^1.0.0
on_connectivity_widget: ^1.0.2
```
## Para fazer:
* Arrumar erros.
* Adicionar mais animações.
* Adicionar mais `[Qualidades]`

## Como usar:

```dart
Expand All @@ -54,8 +60,10 @@ Todos os tipos de métodos nesse plugin:
| `noneWidget` | `Widget?` | `Widget mostrado quando a internet é: Offline.` | <br>
| `animationDuration` | `Duration?` | `Usado para definir quanto tempo a animação irá durar.` | <br>
| `messageDuration` | `Duration?` | `Usado para definir quanto tempo a menssagem irá durar.` | <br>
| `messageDurationWhenOnline` | `Duration?` | `Usado para definir quanto tempo a menssagem irá durar depois de [showNoneUntilOnline].` | <br>
| `animationType` | `Curve?` | `Usado para definir qual animação será mostrada.` | <br>
| `cancelInitState` | `bool?` | `Usado para definir se menssagem será mostrada quando app iniciar.` | <br>
| `showNoneUntilOnline` | `bool?` | `Usado para definir se menssagem será esperar até internet voltar.` | <br>
| `customAnimation` | `Animation<Offset>?` | `Usado se você quer usar sua própria animação.` | <br>
| `customPosition` | `Alignment?` | `Usado se você quer usar sua própria posição.` | <br>

Expand All @@ -66,26 +74,34 @@ Todos os tipos de métodos nesse plugin:
#### OnConnectivityWidget
```dart
OnConnectivityWidget(
animationDuration: Duration(seconds: 2),
messageDuration: Duration(seconds: 1),
animationDuration: Duration(seconds: 1),
messageDuration: Duration(seconds: 2),
position: PositionType.BOTTOM,
showNoneUntilOnline: true,
messageDurationWhenOnline: Duration(seconds: 2),
animationType: Curves.bounceInOut,
cancelInitState: true,
cancelInitState: false,
wifiWidget: Container(
color: Colors.green,
child: Text("Wifi"),
height: 60,
width: double.infinity,
color: Colors.green,
child: Center(child: Text("Wifi")),
),
mobileWidget: Container(
color: Colors.blue,
child: Text("Mobile"),
height: 60,
width: double.infinity,
color: Colors.blue,
child: Center(child: Text("Mobile")),
),
noneWidget: Container(
color: Colors.red,
child: Text("None"),
height: 60,
width: double.infinity,
color: Colors.red,
child: Center(child: Text("None")),
),
//customAnimation: null,
//customPosition: null,
);
),;
```

## LICENÇA:
Expand Down
30 changes: 29 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,35 @@ class _MyAppState extends State<MyApp> {
appBar: AppBar(
title: Text("OnConnectivityExample"),
),
body: OnConnectivityWidget(position: PositionType.TOP),
body: OnConnectivityWidget(
animationDuration: Duration(seconds: 1),
messageDuration: Duration(seconds: 2),
position: PositionType.BOTTOM,
showNoneUntilOnline: true,
messageDurationWhenOnline: Duration(seconds: 2),
animationType: Curves.bounceInOut,
cancelInitState: false,
wifiWidget: Container(
height: 60,
width: double.infinity,
color: Colors.green,
child: Center(child: Text("Wifi")),
),
mobileWidget: Container(
height: 60,
width: double.infinity,
color: Colors.blue,
child: Center(child: Text("Mobile")),
),
noneWidget: Container(
height: 60,
width: double.infinity,
color: Colors.red,
child: Center(child: Text("None")),
),
//customAnimation: null,
//customPosition: null,
),
),
);
}
Expand Down
7 changes: 7 additions & 0 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.2"
on_toast_widget:
dependency: transitive
description:
name: on_toast_widget
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
path:
dependency: transitive
Expand Down
Loading

0 comments on commit 724d72a

Please sign in to comment.