Prepare for Flutter interviews with 40+ questions on widgets, state management, and cross-platform development.
Flutter uses Skia graphics engine to render directly to canvas, bypassing platform UI components. Three trees: Widget (configuration), Element (lifecycle), RenderObject (layout/paint). Widgets are immutable blueprints; when state changes, new widgets are created and diffed against Elements. This gives consistent UI across platforms and high performance.
StatelessWidget: immutable, no internal state, rebuilt only when parent changes. StatefulWidget: mutable state via State object, can trigger rebuilds with setState(). Use StatelessWidget when: UI depends only on constructor params. Use StatefulWidget when: UI changes based on user interaction or data. Prefer StatelessWidget for performance; lift state up when possible.
Keys help Flutter identify widgets when collections change. Types: ValueKey (unique value), ObjectKey (object identity), UniqueKey (always unique), GlobalKey (access state/context across tree). Use keys in: lists with reorderable items, animations, when preserving state during rebuilds. Without keys, Flutter may incorrectly reuse state between different logical widgets.
Built-in: setState (simple, local), InheritedWidget (tree propagation). Popular packages: Provider (recommended by Flutter team, simple DI), Riverpod (improved Provider, compile-safe), BLoC (streams, separation of concerns), GetX (minimal boilerplate), Redux (predictable, time-travel debugging). Choose based on app complexity and team familiarity.
Platform channels: MethodChannel for async method calls, EventChannel for streams. Process: define channel name, implement native code (Swift/Kotlin), call from Dart. Packages like flutter_platform_widgets abstract platform differences. Use Platform.isIOS/isAndroid for conditional logic. Federated plugins separate platform implementations into packages.
Practice with interactive quizzes and get instant feedback.
Start Free Practice