From c63d91cb7e881194884b22daa470e954018a3122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kl=C3=BCpfel?= Date: Fri, 9 Jan 2026 07:53:15 +0100 Subject: [PATCH 1/2] #69: fixes analyzing issue by downgrading to sdk 2.17.0 --- example/lib/crazy_switch.dart | 2 +- example/lib/load_switch.dart | 2 +- example/lib/main.dart | 36 +++++++++++++++++++++++------------ example/pubspec.lock | 16 ++++++++++++++++ example/pubspec.yaml | 5 +++-- 5 files changed, 45 insertions(+), 16 deletions(-) diff --git a/example/lib/crazy_switch.dart b/example/lib/crazy_switch.dart index dda7028..6bb3c99 100644 --- a/example/lib/crazy_switch.dart +++ b/example/lib/crazy_switch.dart @@ -21,7 +21,7 @@ class _CrazySwitchState extends State { const height = 58.0; const innerIndicatorSize = height - 4 * borderWidth; - return CustomAnimatedToggleSwitch( + return CustomAnimatedToggleSwitch( current: current, spacing: 36.0, values: const [false, true], diff --git a/example/lib/load_switch.dart b/example/lib/load_switch.dart index d1e3c92..18f990f 100644 --- a/example/lib/load_switch.dart +++ b/example/lib/load_switch.dart @@ -17,7 +17,7 @@ class _LoadSwitchState extends State { Widget build(BuildContext context) { const height = 50.0; const borderWidth = 5.0; - return CustomAnimatedToggleSwitch( + return CustomAnimatedToggleSwitch( height: height, indicatorSize: const Size.square(height), current: value, diff --git a/example/lib/main.dart b/example/lib/main.dart index f99fcef..a454bd4 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -836,12 +836,18 @@ class _MyHomePageState extends State { ); } - Color colorBuilder(int value) => switch (value) { - 0 => Colors.blueAccent, - 1 => Colors.green, - 2 => Colors.orangeAccent, - _ => Colors.red, - }; + Color colorBuilder(int value) { + switch (value) { + case 0: + return Colors.blueAccent; + case 1: + return Colors.green; + case 2: + return Colors.orangeAccent; + default: + return Colors.red; + } + } Widget coloredRollingIconBuilder(int value, bool foreground) { final color = foreground ? colorBuilder(value) : null; @@ -859,12 +865,18 @@ class _MyHomePageState extends State { return Icon(iconDataByValue(value)); } - IconData iconDataByValue(int? value) => switch (value) { - 0 => Icons.access_time_rounded, - 1 => Icons.check_circle_outline_rounded, - 2 => Icons.power_settings_new_rounded, - _ => Icons.lightbulb_outline_rounded, - }; + IconData iconDataByValue(int? value) { + switch (value) { + case 0: + return Icons.access_time_rounded; + case 1: + return Icons.check_circle_outline_rounded; + case 2: + return Icons.power_settings_new_rounded; + default: + return Icons.lightbulb_outline_rounded; + } + } Widget sizeIconBuilder(BuildContext context, AnimatedToggleProperties local, GlobalToggleProperties global) { diff --git a/example/pubspec.lock b/example/pubspec.lock index b477f8e..d75dd26 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -61,6 +61,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -95,6 +103,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + url: "https://pub.dev" + source: hosted + version: "6.0.0" matcher: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index a4d39c2..af629cd 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=3.0.0 <4.0.0' + sdk: '>=2.17.0 <4.0.0' dependencies: flutter: @@ -14,11 +14,12 @@ dependencies: animated_toggle_switch: path: .. - url_launcher: ^6.1.12 + url_launcher: ^6.3.2 dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 flutter: From e92d71195e906c59e80cfcbfbbaaf59e69421129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kl=C3=BCpfel?= Date: Fri, 9 Jan 2026 07:55:21 +0100 Subject: [PATCH 2/2] updates to version 0.8.7 --- CHANGELOG.md | 4 ++++ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93278cb..dfe6625 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.7 (2026-01-09) + +- fixes [#69](https://github.com/splashbyte/animated_toggle_switch/issues/69) + ## 0.8.6 (2026-01-09) - fixes [#67](https://github.com/splashbyte/animated_toggle_switch/issues/67) diff --git a/pubspec.yaml b/pubspec.yaml index fe9df38..3f1ceed 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.6 +version: 0.8.7 repository: https://github.com/splashbyte/animated_toggle_switch issue_tracker: https://github.com/splashbyte/animated_toggle_switch/issues