All bites
The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.
4330 bites
Page 12
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.
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.
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.
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.
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.
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.
How do you verify a Text widget with 'Hello' is present?
Find.text('Hello') locates the widget; expect(finder, findsOneWidget) asserts exactly one exists.
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.
Unit test a BLoC handling an AddItem event and emitting state
Use blocTest with build, act, expect; mention seed, skip, and mocktail for dependencies.
Testing a tap that triggers a SnackBar
PumpWidget the app, find the button, tester.tap it, call pump or pumpAndSettle to advance frames, then expect a SnackBar finder.
How do you diagnose and fix flaky Flutter widget tests?
Audit unawaited futures, swap pumpAndSettle for explicit pumps or mock timers, and reproduce with logs.
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 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.
iOS code signing for a TestFlight release
A signing certificate proves who built the app; a provisioning profile ties cert, app ID and devices together; configure in Xcode, archive and upload.
What does flutter build appbundle --release do to minimize size?
Dart AOT compiles and tree-shakes dead code; R8 shrinks Android Java/Kotlin; app bundles split by ABI.
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.
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.
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.
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.
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.