From 05af6ccbdf2163f7d3f562ce9cd27de4ce34c896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kl=C3=BCpfel?= Date: Thu, 8 Jan 2026 12:20:58 +0100 Subject: [PATCH 1/5] #67: fixes jerky animation --- CHANGELOG.md | 4 ++++ lib/src/widgets/custom_animated_toggle_switch.dart | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed7e7c..f0a09bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.6 (2026-01-08) + +- 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)) diff --git a/lib/src/widgets/custom_animated_toggle_switch.dart b/lib/src/widgets/custom_animated_toggle_switch.dart index 0d73ce0..2c38c71 100644 --- a/lib/src/widgets/custom_animated_toggle_switch.dart +++ b/lib/src/widgets/custom_animated_toggle_switch.dart @@ -976,7 +976,7 @@ class _CustomAnimatedToggleSwitchState /// Cancels drag because of loading or inactivity void _cancelDrag() { - _setAnimationInfo(_animationInfo.none()); + _setAnimationInfo(_animationInfo.none(current: _positionValue)); _checkValuePosition(); } } From 8bdfb016b8c8d879bbf99684d6c2be850c7efaf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kl=C3=BCpfel?= Date: Thu, 8 Jan 2026 12:27:53 +0100 Subject: [PATCH 2/5] updates version to 0.8.6 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index d93c8ac..f2eff6e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: animated_toggle_switch description: Fully customizable, draggable and animated switch with multiple choices and smooth loading animation. It has prebuilt constructors for rolling and size animations. -version: 0.8.5 +version: 0.8.6 repository: https://github.com/splashbyte/animated_toggle_switch issue_tracker: https://github.com/splashbyte/animated_toggle_switch/issues From 0ec4f1a3ce6ced4846fe72d09833dcb60852f3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kl=C3=BCpfel?= Date: Fri, 9 Jan 2026 07:21:07 +0100 Subject: [PATCH 3/5] updates dependencies --- CHANGELOG.md | 2 +- example/pubspec.lock | 70 +++++++++++------------ pubspec.lock | 131 ++++++++++++++++++------------------------- pubspec.yaml | 4 +- 4 files changed, 93 insertions(+), 114 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0a09bd..93278cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.8.6 (2026-01-08) +## 0.8.6 (2026-01-09) - fixes [#67](https://github.com/splashbyte/animated_toggle_switch/issues/67) diff --git a/example/pubspec.lock b/example/pubspec.lock index 6a448f6..b477f8e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -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: @@ -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 @@ -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: @@ -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: @@ -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" diff --git a/pubspec.lock b/pubspec.lock index d5e8410..6ef4f54 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,39 +5,34 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d url: "https://pub.dev" source: hosted - version: "76.0.0" - _macros: - dependency: transitive - description: dart - source: sdk - version: "0.3.3" + version: "91.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08 url: "https://pub.dev" source: hosted - version: "6.11.0" + version: "8.4.1" args: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.7.0" 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: @@ -74,50 +69,50 @@ packages: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" crypto: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.7" csslib: dependency: transitive description: name: csslib - sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.2" dartdoc: dependency: "direct dev" description: name: dartdoc - sha256: c824d4691231964f8ba24e2fd6f573ac9878fa7a8c188c49f700da18eda79218 + sha256: "73335ae67d2766ff753dc78b0f33ceb399ba5b94a5cfe8ce8d4128fb631717ee" url: "https://pub.dev" source: hosted - version: "8.0.13" + version: "9.0.0" fake_async: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" file: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" flutter: dependency: "direct main" description: flutter @@ -127,10 +122,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -140,74 +135,66 @@ packages: dependency: transitive description: name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" html: dependency: transitive description: name: html - sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" url: "https://pub.dev" source: hosted - version: "0.15.4" + version: "0.15.6" leak_tracker: 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" lints: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "6.0.0" logging: dependency: transitive description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - macros: - dependency: transitive - description: - name: macros - sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 url: "https://pub.dev" source: hosted - version: "0.1.3-main.0" + version: "1.3.0" markdown: dependency: transitive description: name: markdown - sha256: ef2a1298144e3f985cc736b22e0ccdaf188b5b3970648f2d9dc13efd1d9df051 + sha256: "935e23e1ff3bc02d390bad4d4be001208ee92cc217cb5b5a6c19bc14aaa318c1" url: "https://pub.dev" source: hosted - version: "7.2.2" + version: "7.3.0" matcher: dependency: transitive description: @@ -244,10 +231,10 @@ packages: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" path: dependency: transitive description: @@ -260,10 +247,10 @@ packages: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" sky_engine: dependency: transitive description: flutter @@ -313,58 +300,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" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" 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" watcher: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.1" yaml: dependency: transitive description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.9.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index f2eff6e..fe9df38 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,10 +13,10 @@ dependencies: sdk: flutter dev_dependencies: - flutter_lints: ^2.0.2 + flutter_lints: ^6.0.0 flutter_test: sdk: flutter - mocktail: ^1.0.0 + mocktail: ^1.0.4 dartdoc: any flutter: From 7f6977b15ccc9dc7f1de302a02f89f13633c42ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kl=C3=BCpfel?= Date: Fri, 9 Jan 2026 07:26:08 +0100 Subject: [PATCH 4/5] fixes analyzing issues --- lib/src/widgets/animated_toggle_switch.dart | 14 +++++--------- lib/src/widgets/custom_animated_toggle_switch.dart | 8 +++----- lib/src/widgets/hover_region.dart | 3 +-- test/gesture_test.dart | 14 +++++++------- test/helper.dart | 4 ++-- test/listener_test.dart | 4 ++-- 6 files changed, 20 insertions(+), 27 deletions(-) diff --git a/lib/src/widgets/animated_toggle_switch.dart b/lib/src/widgets/animated_toggle_switch.dart index 6195d4b..eb3f9b8 100644 --- a/lib/src/widgets/animated_toggle_switch.dart +++ b/lib/src/widgets/animated_toggle_switch.dart @@ -428,7 +428,7 @@ class AnimatedToggleSwitch required this.values, SimpleIconBuilder? iconBuilder, AnimatedIconBuilder? customIconBuilder, - List? iconList, + super.iconList, this.animationDuration = const Duration(milliseconds: 500), this.animationCurve = Curves.easeInOutCirc, this.indicatorSize = const Size.fromWidth(48.0), @@ -481,7 +481,6 @@ class AnimatedToggleSwitch styleBuilder: styleBuilder, customStyleBuilder: customStyleBuilder, styleList: styleList, - iconList: iconList, ); /// Special version of [AnimatedToggleSwitch.size]. @@ -502,7 +501,7 @@ class AnimatedToggleSwitch Size indicatorSize = const Size.square(1.0), SimpleIconBuilder? iconBuilder, AnimatedIconBuilder? customIconBuilder, - List? iconList, + super.iconList, this.onChanged, this.borderWidth = 2.0, this.style = const ToggleStyle(), @@ -553,7 +552,6 @@ class AnimatedToggleSwitch styleBuilder: styleBuilder, customStyleBuilder: customStyleBuilder, styleList: styleList, - iconList: iconList, ); static AnimatedIconBuilder? _iconSizeBuilder( @@ -599,7 +597,7 @@ class AnimatedToggleSwitch required this.values, SimpleRollingIconBuilder? iconBuilder, RollingIconBuilder? customIconBuilder, - List? iconList, + super.iconList, this.animationDuration = const Duration(milliseconds: 500), this.animationCurve = Curves.easeInOutCirc, this.indicatorSize = const Size.fromWidth(46.0), @@ -663,7 +661,6 @@ class AnimatedToggleSwitch styleBuilder: styleBuilder, customStyleBuilder: customStyleBuilder, styleList: styleList, - iconList: iconList, ); /// Special version of [AnimatedToggleSwitch.rolling]. @@ -684,7 +681,7 @@ class AnimatedToggleSwitch required this.values, SimpleRollingIconBuilder? iconBuilder, RollingIconBuilder? customIconBuilder, - List? iconList, + super.iconList, this.animationDuration = const Duration(milliseconds: 500), this.animationCurve = Curves.easeInOutCirc, Size indicatorSize = const Size.square(1.0), @@ -749,7 +746,6 @@ class AnimatedToggleSwitch styleBuilder: styleBuilder, customStyleBuilder: customStyleBuilder, styleList: styleList, - iconList: iconList, ); static CustomIndicatorBuilder _rollingForegroundIndicatorIconBuilder( @@ -1334,7 +1330,7 @@ class AnimatedToggleSwitch } class _MyLoading extends StatelessWidget { - const _MyLoading({Key? key}) : super(key: key); + const _MyLoading(); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/custom_animated_toggle_switch.dart b/lib/src/widgets/custom_animated_toggle_switch.dart index 2c38c71..8f36b73 100644 --- a/lib/src/widgets/custom_animated_toggle_switch.dart +++ b/lib/src/widgets/custom_animated_toggle_switch.dart @@ -196,7 +196,7 @@ class CustomAnimatedToggleSwitch extends StatefulWidget { final bool _vertical; const CustomAnimatedToggleSwitch({ - Key? key, + super.key, required this.current, required this.values, required this.iconBuilder, @@ -234,8 +234,7 @@ class CustomAnimatedToggleSwitch 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, @@ -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) { diff --git a/lib/src/widgets/hover_region.dart b/lib/src/widgets/hover_region.dart index 6a57873..b548ea6 100644 --- a/lib/src/widgets/hover_region.dart +++ b/lib/src/widgets/hover_region.dart @@ -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(); diff --git a/test/gesture_test.dart b/test/gesture_test.dart index 1d84bd3..721d0f6 100644 --- a/test/gesture_test.dart +++ b/test/gesture_test.dart @@ -17,8 +17,8 @@ void main() { child: buildSwitch( current: current, iconBuilder: iconBuilder, - onTap: tapFunction, - onChanged: changedFunction, + onTap: tapFunction.call, + onChanged: changedFunction.call, ), )); verifyNever(() => tapFunction.call(any())); @@ -60,7 +60,7 @@ void main() { first: values.first, second: values.last, iconBuilder: (value) => iconBuilder(value, true), - onChanged: changedFunction, + onChanged: changedFunction.call, ), )); final currentFinder = find.byKey(iconKey(current, foreground: true)); @@ -83,8 +83,8 @@ void main() { child: buildSwitch( current: current, iconBuilder: iconBuilder, - onTap: tapFunction, - onChanged: changedFunction, + onTap: tapFunction.call, + onChanged: changedFunction.call, // Necessary for AnimatedToggleSwitch.dual spacing: 5.0, ), @@ -116,8 +116,8 @@ void main() { child: buildSwitch( current: current, iconBuilder: iconBuilder, - onTap: tapFunction, - onChanged: changedFunction, + onTap: tapFunction.call, + onChanged: changedFunction.call, iconsTappable: false, ), )); diff --git a/test/helper.dart b/test/helper.dart index 98dcc35..fa424cc 100644 --- a/test/helper.dart +++ b/test/helper.dart @@ -15,11 +15,11 @@ class TestWrapper extends StatelessWidget { final TargetPlatform platform; const TestWrapper({ - Key? key, + super.key, required this.child, this.textDirection = TextDirection.ltr, this.platform = TargetPlatform.android, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/test/listener_test.dart b/test/listener_test.dart index 90f31b6..c19395a 100644 --- a/test/listener_test.dart +++ b/test/listener_test.dart @@ -15,14 +15,14 @@ void main() { child: buildSwitch( current: current, iconBuilder: iconBuilder, - positionListener: positionListener, + positionListener: positionListener.call, ), )); await tester.pumpWidget(TestWrapper( child: buildSwitch( current: next, iconBuilder: iconBuilder, - positionListener: positionListener, + positionListener: positionListener.call, ), )); await tester.pump(const Duration(seconds: 1)); From e14203e7251f681b0084d49aaf0772dc37b0e9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kl=C3=BCpfel?= Date: Fri, 9 Jan 2026 07:28:39 +0100 Subject: [PATCH 5/5] fixes analyzing issue --- example/lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 6afd037..f99fcef 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -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;