diff --git a/examples/get-started/flutter-for/android_devs/lib/animation.dart b/examples/get-started/flutter-for/android_devs/lib/animation.dart index 3c453baeb75..560b7ede30b 100644 --- a/examples/get-started/flutter-for/android_devs/lib/animation.dart +++ b/examples/get-started/flutter-for/android_devs/lib/animation.dart @@ -41,6 +41,12 @@ class _MyFadeTest extends State with TickerProviderStateMixin { curve = CurvedAnimation(parent: controller, curve: Curves.easeIn); } + @override + void dispose() { + controller.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { return Scaffold( diff --git a/examples/get-started/flutter-for/android_devs/lib/events.dart b/examples/get-started/flutter-for/android_devs/lib/events.dart index f74252bb787..9351b3bbb16 100644 --- a/examples/get-started/flutter-for/android_devs/lib/events.dart +++ b/examples/get-started/flutter-for/android_devs/lib/events.dart @@ -62,6 +62,12 @@ class _SampleAppState extends State curve = CurvedAnimation(parent: controller, curve: Curves.easeIn); } + @override + void dispose() { + controller.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { return Scaffold( diff --git a/sites/docs/src/content/flutter-for/android-devs.md b/sites/docs/src/content/flutter-for/android-devs.md index ebe3a45cb3d..3adcae490d1 100644 --- a/sites/docs/src/content/flutter-for/android-devs.md +++ b/sites/docs/src/content/flutter-for/android-devs.md @@ -355,6 +355,12 @@ class _MyFadeTest extends State with TickerProviderStateMixin { curve = CurvedAnimation(parent: controller, curve: Curves.easeIn); } + @override + void dispose() { + controller.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -1671,6 +1677,12 @@ class _SampleAppState extends State curve = CurvedAnimation(parent: controller, curve: Curves.easeIn); } + @override + void dispose() { + controller.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { return Scaffold(