Tagged articles
4 articles
Page 1 of 1
Sohu Tech Products
Sohu Tech Products
Dec 25, 2024 · Mobile Development

Why BuildContext Leaks Memory in Flutter and How to Prevent It

This article explains how BuildContext and various closure patterns in Flutter can cause memory leaks, demonstrates typical leak scenarios with code examples, and provides practical strategies such as disposing listeners, nullifying references, and using WeakReference or Finalizer to ensure proper garbage collection.

AnimationControllerBuildContextDART
0 likes · 10 min read
Why BuildContext Leaks Memory in Flutter and How to Prevent It
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jun 4, 2024 · Mobile Development

Understanding BuildContext in Flutter: Concepts, Properties, and Practical Usage

This article explains the role of BuildContext in Flutter, how to safely use it across asynchronous operations, defines a global navigatorKey for context access, and demonstrates common properties, methods, and scenarios such as navigation, theming, media queries, dialogs, state management, and asset loading.

BuildContextMobile DevelopmentState Management
0 likes · 9 min read
Understanding BuildContext in Flutter: Concepts, Properties, and Practical Usage
Alibaba Terminal Technology
Alibaba Terminal Technology
Nov 17, 2021 · Mobile Development

Building a LeakCanary‑Style Memory Leak Detector for Flutter

This article analyzes why Flutter apps suffer from high memory usage, identifies BuildContext and State as primary leak sources, and proposes a comprehensive, automated detection tool inspired by Android LeakCanary that accurately and efficiently finds memory leaks in production Flutter applications.

BuildContextFlutterLeakCanary
0 likes · 16 min read
Building a LeakCanary‑Style Memory Leak Detector for Flutter
Xianyu Technology
Xianyu Technology
Dec 25, 2018 · Mobile Development

Understanding Flutter Exceptions and Lifecycle Management

The Xianyu tech team’s 2018 Flutter migration cut exception rates from several per‑thousand to under one by targeting two main stack‑trace groups—setState‑related and BuildContext‑related errors—while emphasizing proper lifecycle checks such as verifying mounted before setState and using the correct widget context.

BuildContextExceptionFlutter
0 likes · 6 min read
Understanding Flutter Exceptions and Lifecycle Management