Replies: 2 comments 1 reply
-
Hi, without any code it is hard to guess what happens... Could you please show a bit more? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, sure. Pattern that triggers error: class MyWidget extends StatefulWidget {
String? sessionId;
SomeRustObject? rustObject;
Future<void> handleAuth() async {
rustObject = createRustObject();
final result = await someRustFunction();
switch (result) {
case ResultType_RequiresDialog(:final challenge):
// Extract data from challenge
final data = extractData(challenge: challenge);
// Async operation - widget may rebuild
final userInput = await showDialog<String>(...);
// ERROR: RustArc disposed during async operation
await continueWithRustObject(rustObject: rustObject!);
}
}
} Root cause: RustArc objects stored as widget state get disposed during async Current workaround: Extract all data from RustArc objects immediately and work with // Extract everything immediately
String extractedData = extractData(challenge: challenge);
// Never access 'challenge' again
await showDialog(...);
// Use extractedData instead of RustArc objects Questions:
The workaround works but feels like fighting the framework. Any architectural |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I have to admit that I have zero Flutter/Dart experience but using an AI agent still allows me to iterate quickly and get great results.
DroppableDisposedException: Try to use 'RustArc<dynamic> after it has been disposed
So my agent built a Dart service which I thought is a proper workaround for this issue but still my struct got disposed.
Could you point me in the right direction for keeping my session struct in place across view transitions?
Beta Was this translation helpful? Give feedback.
All reactions