When, why, and how to multithread in Flutter
summary
A demonstration shows that synchronous file and CPU work can steal frames: readAsBytesSync blocks event loop and a direct image filter freezes the UI so the progress indicator never appears. Awaiting an async delay helps only briefly because heavy work still runs on the main isolate. The concrete fixes are: use async I/O and for short tasks call compute spawns short-lived isolate, and for persistent work spawn an isolate and communicate with receive/send ports for long-lived isolates to keep 60fps rendering.
AI-written summary · about
chapters (6)
- 0:00Start
- 1:20Synchronous versus Asynchronous Function Calls
- 2:50Event Handler
- 5:41Image Processing
- 7:04Delayed Api
- 13:37Summary
related talks
32mHeavy lift work in Flutter get started with Isolates
40mFluttering at 60 FPS
34mNative Background Processing with Flutter
44mNo More Jank: How to Keep Your Flutter App Smooth and Snappy
37mUsing Dart FFI for Compute-Heavy Tasks
37mUsing Dart FFI for Compute-Heavy Tasks in Flutter Apps
49mDemystifying performance tune up in Flutter and Dart
49mFirst Flutter, then Fly: Build Reactive & Performant Cross-Platform Apps
