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<CustomSwitch>
         .animate(CurvedAnimation(
             parent: _animationController, curve: Curves.linear));
   }
+  
+  @override
+  void dispose() {
+    _animationController.dispose();
+    super.dispose();
+  }
 
   @override
   Widget build(BuildContext context) {