Closed chutuananh2k closed 2 weeks ago
+1
Hi @chutuananh2k, what device(s) are you seeing this issue on? I just tested on macOS, web and android and I can't seem to reproduce the issue.
Hi @chutuananh2k, click on Floating add button and then click on different tabs, you will be able to re-produce the bug.
This has been fixed on the beta
& master
channels. See the recordings below. Closing this as fixed.
Thank you
beta & master | stable |
---|---|
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
Steps to reproduce
Click to add buton, new tab was created. But when click to newly created tab, an exception occured. The code is the same with #94504
Expected results
No exceptions
Actual results
An exception is thrown (see the logs)
Code sample copied from #94504
```dart import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData(primarySwatch: Colors.blue), home: const MyHomePage(), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({Key? key}) : super(key: key); @override StateLogs
```console ======== Exception caught by animation library ===================================================== The following assertion was thrown while notifying listeners for AnimationController: setState() called after dispose(): _AnimatedState#1e728(lifecycle state: defunct, not mounted) This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback. The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree. This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose(). When the exception was thrown, this was the stack: dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3 throw_ packages/flutter/src/widgets/framework.dart 1167:9Doctor output
```console [✓] Flutter (Channel stable, 3.19.6, on Microsoft Windows [Version 10.0.22631.3447], locale en-US) • Flutter version 3.19.6 on channel stable at C:\dev\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 54e66469a9 (10 days ago), 2024-04-17 13:08:03 -0700 • Engine revision c4cd48e186 • Dart version 3.3.4 • DevTools version 2.31.1 [✓] Windows Version (Installed version of Windows is version 10 or higher) [✗] Android toolchain - develop for Android devices • Android SDK at C:\Users\misa\AppData\Local\Android\sdk ✗ cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. [✓] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.9.34728.123 • Windows 10 SDK version 10.0.22621.0 [✓] Android Studio (version 2023.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874) [✓] VS Code (version 1.88.1) • VS Code at C:\Users\misa\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.84.0 [✓] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3447] • Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.91 • Edge (web) • edge • web-javascript • Microsoft Edge 123.0.2420.97 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 1 category. ```