Skip to content
tezvyn:

Flutter & Dart

Flutter framework, Dart language, packages, Impeller

138 bites

Test yourself: Top 30 Flutter & Dart interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Interview questions in Flutter & Dart, page 5

intermediate2 min read

How would you draw a line graph using Canvas and Path?

Use moveTo for the first point, lineTo for the rest, then Canvas.drawPath with a stroke Paint.

advanced2 min read

Implement staggered animations using a single AnimationController and Interval

This tests multiplexing one ticker into sequential animations. Use one AnimationController, map each Tween to an Interval on distinct 0-to-1 sub-ranges, and rebuild with AnimatedBuilder. Red flag: multiple controllers or manual forward chaining.

advanced1 min read

Diagnosing and fixing CustomPainter jank

Avoid work in paint, gate repaints with shouldRepaint, isolate with RepaintBoundary, cache static layers.

advanced1 min read

Building a custom implicitly animated widget

Extend ImplicitlyAnimatedWidget, use AnimatedWidgetBaseState, define tweens in forEachTween, read values in build.

easy2 min read

What native iOS and Android config does the Flutter camera plugin need?

Tests native platform knowledge beyond Dart. iOS requires NSCameraUsageDescription and NSMicrophoneUsageDescription in Info.plist. Android needs minSdk 24 and choosing between CameraX or Camera2 implementations.

easy2 min read

Explain the purpose of MethodChannel and how it enables Dart-to-native calls

MethodChannel lets Dart encode a method call; the platform host decodes it on the main thread, runs native code, and returns an async result.

intermediate1 min read

MethodChannel data flow and type marshalling

Dart invokeMethod sends a StandardMessageCodec-serialized payload to native, which returns a primitive or map; complex objects must be reduced to supported types.

intermediate2 min read

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.

intermediate2 min read

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.

intermediate3 min read

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.

advanced2 min read

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.

advanced2 min read

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.

easy2 min read

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.

easy2 min read

How do you verify a Text widget with 'Hello' is present?

Find.text('Hello') locates the widget; expect(finder, findsOneWidget) asserts exactly one exists.

intermediate2 min read

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.

intermediate2 min read

Unit test a BLoC handling an AddItem event and emitting state

Use blocTest with build, act, expect; mention seed, skip, and mocktail for dependencies.

intermediate1 min read

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?
advanced2 min read

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.

easy2 min read

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.

easy2 min read

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.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles