From fdd0c18deb3a72edc55f00d07a10ff964377e999 Mon Sep 17 00:00:00 2001 From: boletoms <41501299+boletoms@users.noreply.github.com> Date: Sun, 13 Sep 2020 15:52:02 +1000 Subject: [PATCH] Update custom_switch.dart Updated class with this fix - https://stackoverflow.com/questions/58802223/flutter-ticker-must-be-disposed-before-calling-super-dispose --- lib/custom_switch.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/custom_switch.dart b/lib/custom_switch.dart index c9cf4bf..173f0da 100644 --- a/lib/custom_switch.dart +++ b/lib/custom_switch.dart @@ -44,6 +44,12 @@ class _CustomSwitchState extends State .animate(CurvedAnimation( parent: _animationController, curve: Curves.linear)); } + + @override + void dispose() { + _animationController.dispose(); + super.dispose(); + } @override Widget build(BuildContext context) {