More in Flutter & Dart — page 3
Walk me through Flutter's rendering pipeline and its phases.
Tests your understanding of the three-tree separation and how changes become pixels. Outline: setState marks objects dirty; Build updates elements, Layout computes sizes bottom-up via constraints, and Paint records commands top-down into layers.
Flutter's Widget, Element, and RenderObject trees: roles and relationships
Tests your mental model of Flutter's rendering layers. Strong answer: Widget is immutable configuration; Element is the mutable lifecycle manager owning the RenderObject; RenderObject is the concrete layout and paint entity.
Why use const for Flutter widgets and how does it improve performance?
Tests widget canonicalization and rebuild short-circuiting. Strong answer: const enables instance reuse and skips subtree rebuilds on parent updates, reducing allocations.
Debug iOS code signing failure in CI that works locally
This tests Xcode code signing and CI keychain isolation. A strong answer checks exportOptions.plist, keychain profile presence, runner OS and Xcode versions, and entitlements mismatches. Red flag: manual local fixes or ignoring keychain access gaps.
How do you handle platform-specific configurations per flavor on Android and iOS?
Tests if you know flavors delegate icons and titles to native tooling. On Android, use productFlavors in build.gradle with source sets or placeholders; on iOS, use Xcode build configurations with Info.plist values or asset catalogs.
Walk me through a Flutter CI/CD pipeline for Play Store and TestFlight
Tests your ability to orchestrate multi-platform Flutter builds, manage signing secrets, and automate deployments to Google Play Internal Testing and Apple TestFlight.
What does flutter build appbundle --release do to minimize size?
WHAT IT TESTS: Fluency in the Flutter release pipeline and Dart-Android optimization boundaries. ANSWER OUTLINE: Dart AOT compiles and tree-shakes dead code; R8 shrinks Android Java/Kotlin; app bundles split by ABI.
How would you manage different backend environments in a Flutter project?
Tests Flutter build flavors and compile-time config injection. A strong answer uses dart-define or flavor-specific entry points plus an EnvironmentConfig abstraction. A red flag is manually swapping hard-coded base URLs before each build.
Flutter command for an Android release build and APK vs AAB difference.
Flutter CLI release commands and Android distribution formats. Name flutter build apk and flutter build appbundle; note AAB lets Google Play generate optimized APKs per device while APK is a single direct-install file.
How do you diagnose and fix flaky Flutter widget tests?
WHAT IT TESTS: Deterministic control of Flutter async and animation timing. ANSWER OUTLINE: Audit unawaited futures, swap pumpAndSettle for explicit pumps or mock timers, and reproduce with logs. RED FLAG: Retries or sleeps instead of removing timing leaks.
Unit test a BLoC handling an AddItem event and emitting state
WHAT IT TESTS: Whether you know BLoC testing idioms and why bloc_test beats manual assertions. ANSWER OUTLINE: Use blocTest with build, act, expect; mention seed, skip, and mocktail for dependencies.
How do you widget-test states without real network calls?
This tests UI isolation from I/O. Mock the repository with Mockito, stub methods to yield loading, success, and error, and inject it via constructor or provider. Avoid real HTTP calls or unmocked clients in widget tests.
How do you verify a Text widget with 'Hello' is present?
WHAT IT TESTS: Flutter finder vs matcher API fluency. ANSWER OUTLINE: find.text('Hello') locates the widget; expect(finder, findsOneWidget) asserts exactly one exists.
Unit, widget, and integration test differences in Flutter
Tests your grasp of Flutter's test pyramid and isolation levels. Unit tests check pure Dart logic; widget tests verify UI in a headless environment; integration tests exercise the full app on a device. Red flag: saying widget tests require an emulator.
What is Pigeon and how does it improve platform channels?
This tests type-safe platform channels versus manual MethodChannel boilerplate. Answer: Pigeon is a dev-time code generator that creates typed host stubs from a Dart contract, removing string keys and encoding. Red flag: calling it a runtime library.
Present full-screen native SDK UI from Flutter and return a result
This tests platform channel architecture for full-screen native UI delegation. Use MethodChannel to launch the native controller, retain the async result callback, serialize the dismissal payload back to Dart, and avoid PlatformView for modal flows.
Safely gating native OS version APIs in a custom Flutter plugin
Tests platform channel contracts and defensive native coding. Gate native calls with OS version checks, return result.error with an UNSUPPORTED code, handle PlatformException in Dart, and avoid Dart-only checks.
What is a Platform View and why is it crucial?
Tests embedding native UI when Flutter widgets fall short. Strong answers define Platform Views as native embeddings, cite maps or WebView, and contrast Hybrid Composition's native hierarchy with Virtual Display's texture rasterization.
When to choose EventChannel over MethodChannel and native setup
It tests streaming versus one-shot platform communication. Pick EventChannel for ongoing native events like sensor data; register a StreamHandler on Android or iOS that feeds an event sink, then consume in Dart via receiveBroadcastStream.
Explain the purpose of MethodChannel and how it enables Dart-to-native calls
WHAT IT TESTS: Your grasp of the async bridge. ANSWER OUTLINE: MethodChannel lets Dart encode a method call; the platform host decodes it on the main thread, runs native code, and returns an async result. RED FLAG: Calling it synchronous or direct binding.