Skip to content

Commit bca49e9

Browse files
committed
version 0.8.0-beta.6
1 parent 9f44f9d commit bca49e9

6 files changed

Lines changed: 16 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.8.0-beta.6
1+
## 0.8.0-beta.6 (2023-08-22)
22

33
- adds parameter to `onTap` ([#41](https://github.com/splashbyte/animated_toggle_switch/issues/41))
44

lib/src/properties.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ class GlobalToggleProperties<T> {
5757

5858
/// This animation indicates whether the indicator is currently visible.
5959
///
60-
/// 0.0 means it is not visible.
60+
/// [0.0] means it is not visible.
6161
///
62-
/// 1.0 means it is fully visible.
62+
/// [1.0] means it is fully visible.
6363
///
6464
/// Depending on the curve of the animation, the value can also be below 0.0 or above 1.0.
6565
///
@@ -231,9 +231,15 @@ class TapInfo<T> {
231231
final T value;
232232

233233
/// The index of [value] in [values].
234+
///
235+
/// [index == position.round()] should always be [true].
234236
final int index;
235237

236238
/// The tapped position relative to the indices of the values.
239+
///
240+
/// [position] can be in the interval from [-0.5] to [values.length - 0.5].
241+
///
242+
/// [position.round() == index] should always be [true].
237243
final double position;
238244

239245
TapInfo({

lib/src/widgets/animated_toggle_switch.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ abstract class _AnimatedToggleSwitchParent<T> extends StatelessWidget {
7272
/// If you want to implement a completely custom switch,
7373
/// you should use [CustomAnimatedToggleSwitch], which is used by
7474
/// [AnimatedToggleSwitch] in the background.
75-
class AnimatedToggleSwitch<T> extends _AnimatedToggleSwitchParent<T> {
75+
class AnimatedToggleSwitch<T extends Object?>
76+
extends _AnimatedToggleSwitchParent<T> {
7677
/// The currently selected value. It has to be set at [onChanged] or whenever for animating to this value.
7778
///
7879
/// [current] has to be in [values] for working correctly if [allowUnlistedValues] is false.

lib/src/widgets/custom_animated_toggle_switch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ enum IconArrangement {
5959
///
6060
/// For pre-made switches, please use the constructors of [AnimatedToggleSwitch]
6161
/// instead.
62-
class CustomAnimatedToggleSwitch<T> extends StatefulWidget {
62+
class CustomAnimatedToggleSwitch<T extends Object?> extends StatefulWidget {
6363
/// The currently selected value. It has to be set at [onChanged] or whenever for animating to this value.
6464
///
6565
/// [current] has to be in [values] for working correctly if [allowUnlistedValues] is false.

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ packages:
223223
dependency: "direct dev"
224224
description:
225225
name: mocktail
226-
sha256: "80a996cd9a69284b3dc521ce185ffe9150cde69767c2d3a0720147d93c0cef53"
226+
sha256: "9503969a7c2c78c7292022c70c0289ed6241df7a9ba720010c0b215af29a5a58"
227227
url: "https://pub.dev"
228228
source: hosted
229-
version: "0.3.0"
229+
version: "1.0.0"
230230
node_preamble:
231231
dependency: transitive
232232
description:

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: animated_toggle_switch
22
description: Fully customizable, draggable and animated switch with multiple choices and smooth loading animation. It has prebuilt constructors for rolling and size animations.
3-
version: 0.8.0-beta.5
3+
version: 0.8.0-beta.6
44
repository: https://github.com/SplashByte/animated_toggle_switch
55
issue_tracker: https://github.com/SplashByte/animated_toggle_switch/issues
66

@@ -16,7 +16,7 @@ dev_dependencies:
1616
flutter_lints: ^2.0.2
1717
flutter_test:
1818
sdk: flutter
19-
mocktail: ^0.3.0
19+
mocktail: ^1.0.0
2020

2121
flutter:
2222

0 commit comments

Comments
 (0)