Memory & Performance
Memory leaks, dispose, DevTools profiler, widget rebuilds, const constructors, keys
1Which method must be called in dispose() to avoid a memory leak with an AnimationController?
Which method must be called in dispose() to avoid a memory leak with an AnimationController?
Cevap
The AnimationController's dispose() method releases resources associated with the animation controller, including listeners and internal timers. Without this call, the controller continues running in the background even after the widget is destroyed, causing a memory leak and potentially errors if the controller attempts to update a removed widget.
2Which Flutter DevTools tool allows identifying memory leaks?
Which Flutter DevTools tool allows identifying memory leaks?
Cevap
The Memory Profiler in Flutter DevTools provides a detailed view of the application's memory usage. It allows capturing heap snapshots, analyzing objects in memory, detecting instances not collected by the garbage collector, and identifying references preventing memory from being freed.
3How to reduce unnecessary widget rebuilds in Flutter?
How to reduce unnecessary widget rebuilds in Flutter?
Cevap
Using const before widget constructors allows the framework to reuse the same instance rather than creating a new one on each build. This prevents unnecessary rebuilds because Flutter recognizes the widget hasn't changed. Const widgets are created at compile time and kept in memory for reuse.
What is the main cause of a memory leak with a StreamController?
Which type of Key should be used to optimize ListView performance with reorderable items?
+19 mülakat soruları
Diğer Flutter mülakat konuları
Dart Basics
Dart Language Essentials
Flutter Fundamentals
Widget Lifecycle
Local Storage
Application Lifecycle
Layouts & Constraints
ListView & GridView
Navigation & Routing
Basic State Management
Provider Pattern
Networking & HTTP
JSON Serialization
Local Database
Forms & Validation
Animations
Firebase Integration
Unit Testing
Widget Testing
Build & Deployment
Package Management
Streams & RxDart
Advanced State Management
Flutter Design Patterns
Performance Optimization
Platform Channels
Custom Painting
Flutter Application Architecture
Bir sonraki mülakatın için Flutter'de uzmanlaş
Tüm sorulara, flashcards'a, teknik testlere, code review alıştırmalarına ve mülakat simülatörlerine eriş.
Ücretsiz başla