Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maeddin committed Dec 22, 2022
1 parent 2d56a24 commit 2afd45d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ AnimatedToggleSwitch<int>.rolling(
```

### Simple rolling animation with loading
To use the loading animation, you simply have to return a future in `onChanged` or `onTap`.
To use the loading animation, you simply have to return a `Future` in `onChanged` or `onTap`.
You can alternatively control the loading manually with the `loading` parameter.
Hence, to disable the loading animation, `loading: false` must be set.

```dart
AnimatedToggleSwitch<int>.rolling(
current: value,
values: [0, 1, 2, 3],
onChanged: (i) {
onChanged: (i) async {
setState(() => value = i);
return Future.delayed(Duration(seconds: 3));
await Future.delayed(Duration(seconds: 3));
},
loading: false, // for deactivating loading animation
iconBuilder: iconBuilder,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: animated_toggle_switch
description: Simple and animated toggle switch for multiple choices and loading animation. It's a good alternative if you don't want to use something like a dropdown menu.
description: Simple and animated switch with multiple choices and smooth loading animation. It's a good alternative if you don't want to use something like a dropdown menu.
version: 0.6.1
repository: https://github.com/SplashByte/animated_toggle_switch

Expand Down

0 comments on commit 2afd45d

Please sign in to comment.