Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.6 (2026-01-09)

- fixes [#67](https://github.com/splashbyte/animated_toggle_switch/issues/67)

## 0.8.5 (2025-04-28)

- adds `padding` to `AnimatedToggleSwitch` ([#65](https://github.com/splashbyte/animated_toggle_switch/issues/65))
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
const MyHomePage({super.key, required this.title});

final String title;

Expand Down
70 changes: 35 additions & 35 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ packages:
path: ".."
relative: true
source: path
version: "0.8.4"
version: "0.8.6"
async:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.13.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -52,10 +52,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.3"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -75,26 +75,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
version: "10.0.8"
version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -184,50 +184,50 @@ packages:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.4"
version: "0.7.6"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3"
sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8
url: "https://pub.dev"
source: hosted
version: "6.3.0"
version: "6.3.2"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "94d8ad05f44c6d4e2ffe5567ab4d741b82d62e3c8e288cc1fcea45965edf47c9"
sha256: "767344bf3063897b5cf0db830e94f904528e6dd50a6dfaf839f0abf509009611"
url: "https://pub.dev"
source: hosted
version: "6.3.8"
version: "6.3.28"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e
sha256: cfde38aa257dae62ffe79c87fab20165dfdf6988c1d31b58ebf59b9106062aad
url: "https://pub.dev"
source: hosted
version: "6.3.1"
version: "6.3.6"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af
sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a
url: "https://pub.dev"
source: hosted
version: "3.2.0"
version: "3.2.2"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de"
sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18"
url: "https://pub.dev"
source: hosted
version: "3.2.0"
version: "3.2.5"
url_launcher_platform_interface:
dependency: transitive
description:
Expand All @@ -240,42 +240,42 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e"
sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2"
url: "https://pub.dev"
source: hosted
version: "2.3.3"
version: "2.4.1"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185"
sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
version: "3.1.5"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "15.0.2"
web:
dependency: transitive
description:
name: web
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
version: "1.1.1"
sdks:
dart: ">=3.7.0-0 <4.0.0"
flutter: ">=3.22.0"
dart: ">=3.9.0 <4.0.0"
flutter: ">=3.35.0"
14 changes: 5 additions & 9 deletions lib/src/widgets/animated_toggle_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class AnimatedToggleSwitch<T extends Object?>
required this.values,
SimpleIconBuilder<T>? iconBuilder,
AnimatedIconBuilder<T>? customIconBuilder,
List<Widget>? iconList,
super.iconList,
this.animationDuration = const Duration(milliseconds: 500),
this.animationCurve = Curves.easeInOutCirc,
this.indicatorSize = const Size.fromWidth(48.0),
Expand Down Expand Up @@ -481,7 +481,6 @@ class AnimatedToggleSwitch<T extends Object?>
styleBuilder: styleBuilder,
customStyleBuilder: customStyleBuilder,
styleList: styleList,
iconList: iconList,
);

/// Special version of [AnimatedToggleSwitch.size].
Expand All @@ -502,7 +501,7 @@ class AnimatedToggleSwitch<T extends Object?>
Size indicatorSize = const Size.square(1.0),
SimpleIconBuilder<T>? iconBuilder,
AnimatedIconBuilder<T>? customIconBuilder,
List<Widget>? iconList,
super.iconList,
this.onChanged,
this.borderWidth = 2.0,
this.style = const ToggleStyle(),
Expand Down Expand Up @@ -553,7 +552,6 @@ class AnimatedToggleSwitch<T extends Object?>
styleBuilder: styleBuilder,
customStyleBuilder: customStyleBuilder,
styleList: styleList,
iconList: iconList,
);

static AnimatedIconBuilder<T>? _iconSizeBuilder<T>(
Expand Down Expand Up @@ -599,7 +597,7 @@ class AnimatedToggleSwitch<T extends Object?>
required this.values,
SimpleRollingIconBuilder<T>? iconBuilder,
RollingIconBuilder<T>? customIconBuilder,
List<Widget>? iconList,
super.iconList,
this.animationDuration = const Duration(milliseconds: 500),
this.animationCurve = Curves.easeInOutCirc,
this.indicatorSize = const Size.fromWidth(46.0),
Expand Down Expand Up @@ -663,7 +661,6 @@ class AnimatedToggleSwitch<T extends Object?>
styleBuilder: styleBuilder,
customStyleBuilder: customStyleBuilder,
styleList: styleList,
iconList: iconList,
);

/// Special version of [AnimatedToggleSwitch.rolling].
Expand All @@ -684,7 +681,7 @@ class AnimatedToggleSwitch<T extends Object?>
required this.values,
SimpleRollingIconBuilder<T>? iconBuilder,
RollingIconBuilder<T>? customIconBuilder,
List<Widget>? iconList,
super.iconList,
this.animationDuration = const Duration(milliseconds: 500),
this.animationCurve = Curves.easeInOutCirc,
Size indicatorSize = const Size.square(1.0),
Expand Down Expand Up @@ -749,7 +746,6 @@ class AnimatedToggleSwitch<T extends Object?>
styleBuilder: styleBuilder,
customStyleBuilder: customStyleBuilder,
styleList: styleList,
iconList: iconList,
);

static CustomIndicatorBuilder<T> _rollingForegroundIndicatorIconBuilder<T>(
Expand Down Expand Up @@ -1334,7 +1330,7 @@ class AnimatedToggleSwitch<T extends Object?>
}

class _MyLoading extends StatelessWidget {
const _MyLoading({Key? key}) : super(key: key);
const _MyLoading();

@override
Widget build(BuildContext context) {
Expand Down
10 changes: 4 additions & 6 deletions lib/src/widgets/custom_animated_toggle_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class CustomAnimatedToggleSwitch<T extends Object?> extends StatefulWidget {
final bool _vertical;

const CustomAnimatedToggleSwitch({
Key? key,
super.key,
required this.current,
required this.values,
required this.iconBuilder,
Expand Down Expand Up @@ -234,8 +234,7 @@ class CustomAnimatedToggleSwitch<T extends Object?> extends StatefulWidget {
assert(foregroundIndicatorBuilder != null ||
backgroundIndicatorBuilder != null),
assert(separatorBuilder == null ||
(spacing > 0 && iconArrangement == IconArrangement.row)),
super(key: key);
(spacing > 0 && iconArrangement == IconArrangement.row));

const CustomAnimatedToggleSwitch._({
required this.current,
Expand Down Expand Up @@ -976,7 +975,7 @@ class _CustomAnimatedToggleSwitchState<T>

/// Cancels drag because of loading or inactivity
void _cancelDrag() {
_setAnimationInfo(_animationInfo.none());
_setAnimationInfo(_animationInfo.none(current: _positionValue));
_checkValuePosition();
}
}
Expand Down Expand Up @@ -1031,12 +1030,11 @@ class _WidgetPart extends StatelessWidget {
final Widget child;

const _WidgetPart({
Key? key,
this.width = double.infinity,
this.height = double.infinity,
required this.left,
required this.child,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
3 changes: 1 addition & 2 deletions lib/src/widgets/hover_region.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ class _HoverRegion extends StatefulWidget {
final MouseCursor defaultCursor;

const _HoverRegion({
Key? key,
required this.child,
required this.cursorByOffset,
this.defaultCursor = MouseCursor.defer,
}) : super(key: key);
});

@override
State<_HoverRegion> createState() => _HoverRegionState();
Expand Down
Loading