diff --git a/example/lib/main.dart b/example/lib/main.dart index 8044f17e..c57109d2 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -20,6 +20,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { final _appLifecycleListener = AppLifecycleListener( onExitRequested: () async { + // Stop Rust tasks before closing the Flutter app. await RustInFlutter.ensureFinalized(); return AppExitResponse.exit; },