Flutter Ecosystem
The Flutter framework plus the libraries and tools around it: BLoC, Riverpod, Provider and other state libraries, the flutter CLI, FVM and Codemagic. Interviewers use it to gauge real Flutter depth.
on this pageshowhide
explore
- Flutter (has its own guide)525 questions
- Widget Kinds & Lifecycle26 questions
- Engine & Frame Pipeline25 questions
- Box Layout Model26 questions
- Scrollable Views28 questions
- Visual Design Kits27 questions
- Bundled Resources21 questions
- Built-In Reactivity19 questions
- Codebase Layering23 questions
- Navigation & Routing30 questions
- Animation System30 questions
- Gestures & Focus15 questions
- Accessibility & Locales21 questions
- Backend API Calls26 questions
- On-Device Persistence24 questions
- FlutterFire Plugins29 questions
- Native Interop36 questions
- Dev Loop & DevTools30 questions
- Jank & Size Tuning26 questions
- Automated Verification21 questions
- Shipping to Stores30 questions
- Web & Desktop Targets12 questions
- BLoC27 questions
- Cubit Classes6 questions
- Event Handlers & Concurrency5 questions
- Builder & Listener Widgets6 questions
- Unit Test Helpers5 questions
- Observers & Hydration5 questions
- Riverpod (has its own guide)31 questions
- Declared Provider Types5 questions
- Ref Watch, Read & Listen5 questions
- Auto-Dispose & Families5 questions
- AsyncValue States5 questions
- Annotation Codegen6 questions
- Overrides & Containers5 questions
- Provider15 questions
- Notifier & Proxy Types5 questions
- Consumer & Selector5 questions
- Scoping & Disposal5 questions
- GetX6 questions
- RxDart9 questions
- Subjects & ValueStream4 questions
- Stream Operators5 questions
- Flutter Redux5 questions
- Flutter CLI11 questions
- SDK Channels & Doctor5 questions
- Daily Commands6 questions
- FVM5 questions
- Codemagic6 questions
→ has its own guide
questions
640 · 10 sectionsIn Flutter, why is calling setState from an AnimationController listener on every tick discouraged, and what replaces it?
basics
~20 ssetState in a controller listener re-runs the State's whole build method every frame, rebuilding widgets that never change. AnimatedBuilder or a FooTransition widget scopes the rebuild to what depends on the animation, and FadeTransition avoids widget rebuilds altogether.
In a Flutter StatefulWidget, how do you create, start, stop and dispose an AnimationController for a pulsing record button?
basics
~20 sMix a ticker provider into the State, create the controller in initState with vsync: this and a duration, call repeat(reverse: true) while recording, stop or animate it back when recording ends, and dispose it in dispose before super.dispose().
In Flutter, how does a Hero animation carry a widget between two routes, and what must the two Hero widgets share?
basics
~20 sThe app's HeroController pairs Hero widgets with equal tags on the outgoing and incoming PageRoutes. During the route transition, the destination hero's child flies in the Navigator's overlay between their bounds while placeholders fill both original slots.
In Flutter, how does AnimatedContainer animate a property change, and when do you need an AnimationController instead of an implicit widget?
basics
~20 sAnimatedContainer's State keeps its own AnimationController; when a rebuild passes a new property value it tweens from the current value to it over duration and curve. Loops, on-demand playback, gestures and shared timelines need an explicit controller.
In Flutter's animation library, what does a Tween do, and how does Tween.animate() relate to Animation.drive()?
basics
~10 sA Tween is an Animatable that maps a 0.0-to-1.0 animation value onto a begin-to-end range of sizes, colors or offsets. tween.animate(controller) and controller.drive(tween) are the same operation written from opposite ends.
With package:bloc, what is a Cubit, and how does it hold, change and publish its state?
basics
~20 sA Cubit is a bloc-package state holder: it starts from the value passed to super, changes only when its own methods call emit, exposes the current value through state and publishes each later change on a broadcast stream.
With package:bloc, how does a Bloc turn an event passed to add into one or more new states?
basics
~20 sA Bloc receives event objects through add. Each event type has one handler registered with on<E> in the constructor; the handler gets the event and an Emitter and calls it zero or more times, often around an await, to produce new states.
With the bloc_test package, how does blocTest drive a Bloc through build, act and expect, and why is the initial state missing from expect?
basics
~20 sblocTest builds a fresh bloc, subscribes to its state stream, runs act, closes the bloc and compares every state emitted after that against expect, in order. The constructor's initial state is never pushed to the stream, so it is never recorded.
With flutter_bloc, how do BlocBuilder and BlocListener differ, and which one should show a login-failure dialog?
basics
~20 sBlocBuilder rebuilds part of the UI from the current state and may run its builder many times, so it must be pure. BlocListener runs a void callback once per state change, never for the initial state, so dialogs, snackbars and navigation belong there.
With package:bloc, when is a Cubit enough, and what would make you choose an event-driven Bloc instead?
basics
~20 sA Cubit is enough when state changes are direct method calls. Choose a Bloc when you need each change traced to the event that caused it, or need to transform incoming events, such as debouncing a search or dropping overlapping requests.
In Riverpod 3, what is AsyncValue, and how do you render its loading, data and error states in a Flutter widget?
basics
~10 sAsyncValue is Riverpod's sealed result type for async providers: AsyncData, AsyncLoading or AsyncError. A widget watches the provider and switches over the AsyncValue - exhaustively, with no default - or calls when(data:, error:, loading:).
In Riverpod 3 with riverpod_generator, what does annotating a function versus a Notifier class with @riverpod generate, and how is it named?
basics
~20 sAn annotated function with a Ref first parameter becomes a read-only functional provider whose kind follows its return type; an annotated class extending _$Name with build() becomes a notifier provider. Names are lower camel case plus Provider, with a trailing Notifier stripped.
In Riverpod 3, what does autoDispose do, and why does a product-detail screen refetch after you leave and reopen it?
basics
~20 sautoDispose destroys a provider's state once nothing listens to it any more. Leaving the product screen removes its last listener, so the state and fetched product are dropped; reopening reads the provider again, which rebuilds it and refetches.
In Riverpod 3, which provider type fits a computed value, a one-off async load, a live stream, and state the UI changes?
basics
~10 sProvider for a synchronous computed or injected value, FutureProvider for data loaded once, StreamProvider for values that keep arriving, and NotifierProvider or AsyncNotifierProvider when the UI must change the state through methods.
In Riverpod 3, what is the difference between ref.watch, ref.read and ref.listen, and where does each one belong?
basics
~20 sref.watch returns a provider's value and subscribes, so the widget or provider rebuilds on change; ref.read returns the current value once with no subscription, for event handlers; ref.listen runs a callback on change for side effects like a snackbar.
With the provider package, what is the difference between context.watch, context.read and context.select, and when do you use each?
basics
~10 scontext.watch<T>() returns the nearest provided T and rebuilds the widget when it notifies; context.read<T>() returns it without subscribing, for callbacks; context.select rebuilds only when the value its selector derives changes.
With the provider package, which widgets can read a provider, and how do you decide where to place ChangeNotifierProvider in the tree?
basics
~20 sOnly descendants of a provider widget can read it, and the nearest provider of the requested type wins. Place ChangeNotifierProvider at the lowest common ancestor of every widget and route that reads it, no higher than its state should live.
In Flutter's provider package, which provider class fits a plain object, a ChangeNotifier, a Future and a Stream, and why?
basics
~10 sProvider exposes a plain value without listening; ChangeNotifierProvider listens to a ChangeNotifier and disposes it; ListenableProvider and ValueListenableProvider cover other listenables; FutureProvider and StreamProvider expose an async result, starting from a required initialData.
With the provider package, why does context.watch fail inside onPressed or initState, and what should those call sites use instead?
basics
~20 scontext.watch subscribes the widget, which is only meaningful during build: in onPressed provider's debug assertion rejects listening, and in initState Flutter rejects the dependency. Use context.read, or Provider.of with listen: false, at both call sites.
With Flutter's provider package, when do you use a provider's create constructor versus its .value constructor, and what breaks when they are swapped?
basics
~20 sUse create when the provider builds and owns the object, .value when it exposes an instance owned elsewhere. A new object inside .value is recreated on every rebuild; an existing instance passed to create gets disposed while still in use.
In GetX, how do .obs values and the Obx widget make a Flutter widget rebuild, and what must the Obx builder do?
basics
~20 sCalling .obs wraps a value in an Rx type such as RxInt. Obx records every Rx whose value its builder reads while running and rebuilds when one changes; a builder that reads no observable throws GetX's 'improper use' error.
In GetX, how do Get.put, Get.lazyPut and Bindings differ, and when do a GetxController's onInit, onReady and onClose run?
basics
~20 sGet.put registers and starts an instance immediately; Get.lazyPut registers a builder that runs on the first Get.find. Bindings group those calls per route. onInit runs when the instance starts, onReady one frame later, onClose when it is deleted.
In GetX, how does GetBuilder with update() differ from Obx with .obs values, and when would you choose each?
basics
~20 sGetBuilder rebuilds when the controller calls update(), optionally only builders with a given id, and works with plain fields. Obx rebuilds automatically when an Rx value read in its builder changes. GetBuilder is explicit and cheaper; Obx is less code.
A small Flutter prototype built with GetX now needs a test suite for a growing team; what makes its controllers and screens hard to test, and how do you fix that?
basics
~20 sGetX state lives in one global registry, so tests leak instances, Get.find hides dependencies and navigating controllers need a navigator. Call Get.reset() in tearDown, register fakes first, inject dependencies by constructor and move navigation behind an interface.
In RxDart, what does a new listener receive from a BehaviorSubject, a PublishSubject and a ReplaySubject, and which suits UI state?
basics
~20 sA late BehaviorSubject listener first gets the latest value (or error), a PublishSubject listener gets only later events, and a ReplaySubject listener gets the buffered history, capped by maxSize. BehaviorSubject suits UI state: late listeners see the current value.
How would you build a Flutter movie search with RxDart so keystrokes are debounced and results from stale queries never reach the screen?
basics
~20 sFeed TextField changes into a stream, apply debounceTime so a query fires only after typing pauses, drop repeats with distinct, then switchMap each query to the search call so a newer query unsubscribes from the older one and stale results are discarded.
In RxDart, how do switchMap, exhaustMap and flatMap differ, and which fits a search box, a submit button and parallel poster downloads?
basics
~20 sswitchMap cancels the running inner stream when a new event arrives, exhaustMap ignores new events until the running one completes, and flatMap runs them all concurrently, optionally capped by maxConcurrent. Search wants switchMap, a submit button exhaustMap, parallel downloads flatMap.
In a Flutter app, when do Dart's core Stream methods suffice, and which RxDart operators have no core Stream equivalent?
basics
~20 sCore Stream already maps, filters, de-duplicates and runs async work in order (map, where, distinct, asyncMap, asyncExpand). RxDart earns its dependency for timing (debounceTime, throttleTime), cancel-or-ignore flattening (switchMap, exhaustMap, flatMap) and combining sources (combineLatest2, zip2, merge, withLatestFrom).
In RxDart, what do throttleTime's leading and trailing defaults do, and why would a throttled movie search miss the final query?
basics
~20 sthrottleTime defaults to leading: true and trailing: false: it emits the first event, then drops everything else for the duration. Typing "dune" quickly searches for "d" and never for "dune"; search needs debounceTime or trailing: true.
In a Flutter app using redux and flutter_redux, what are the Store, a reducer and StoreProvider, and how does a dispatched action reach a widget?
basics
~20 sThe Store holds all app state and is built from a reducer, an initialState and middleware; a reducer maps state and action to the next state. StoreProvider exposes the Store; after a dispatch the Store emits onChange and connected widgets rebuild.
In flutter_redux, what does StoreConnector's converter do, and why must the view model implement == when distinct is true?
basics
~20 sThe converter maps the Store to a small view model and runs on every store change. With distinct: true, StoreConnector rebuilds only when the new view model != the previous one, so the view model needs value equality.
Why is flutter_redux uncommon in current Flutter codebases, and what would you check before extending a legacy point-of-sale app built on it?
basics
~10 sflutter_redux needs one global store, a converter and value-equal view model per widget, dynamic actions and extra middleware for async work. Before extending a legacy app, check the package version, rebuild cost and conventions.
In a Flutter redux app, how do you run async work such as a card-payment call through middleware, and what does a thunk middleware change?
basics
~20 sMiddleware sees each action before the reducer: on a charge action it calls next(action), starts the payment future and later dispatches a success or failure action. A thunk middleware lets you dispatch a function that receives the store.
In flutter_redux, when do StoreConnector's onInit, onWillChange, onDidChange and onInitialBuild run, and which one should trigger navigation?
basics
~20 sonInit runs in initState before the first view model is built, onWillChange runs on a change before the rebuild, onDidChange and onInitialBuild run after the frame via post-frame callbacks, and onDispose runs in dispose. Navigation belongs in onWillChange.
With flutter create, how do you start an app for Android, iOS and web only, and what do --org and --platforms control?
basics
~10 sRun flutter create --org com.acme --platforms android,ios,web shop_app. --org sets the reverse-domain prefix of the Android application ID and iOS bundle ID; --platforms decides which platform folders are generated.
In Flutter, how do flutter devices, flutter emulators and flutter run -d work together to run an app on a chosen device?
basics
~10 sflutter devices lists connected devices with their ids, flutter emulators --launch starts an emulator or simulator, and flutter run -d <id or name prefix> runs on that device; -d all targets every device.
In Flutter, what does the flutter doctor command check, and how do you read its markers and the extra detail flutter doctor -v adds?
basics
~20 sflutter doctor runs validators for the Flutter SDK, each host toolchain, connected devices and network access, marking each [✓] ready, [!] partial or [✗] missing with a fix hint; -v adds paths, revisions and timings.
How do you install the Flutter SDK so flutter and dart work in any terminal, and what does flutter doctor flag when PATH is wrong?
basics
~10 sExtract the Flutter SDK to a user-writable folder and put its bin directory on PATH, which provides both flutter and dart. Doctor warns when either is missing from PATH or resolves outside that SDK.
What does flutter clean delete in a Flutter project, and when does it fix a build rather than just slow the next one?
basics
~20 sflutter clean deletes the project's build/ and .dart_tool/ directories, platform ephemeral folders and generated files, and cleans the Xcode workspace. It helps when stale generated state survives an SDK, plugin or config change; otherwise it only forces a slower full rebuild.
With two client Flutter apps needing different SDK versions on one laptop, how does FVM keep each project on its own version?
basics
~20 sFVM keeps several Flutter SDKs in a shared cache and records each project's version in a committed .fvmrc file; fvm flutter and fvm dart then run the SDK that project pins, so the two apps never share one global Flutter.
In FVM, how do fvm use and fvm global differ, and which SDK does fvm flutter pick when both are set?
basics
~20 sfvm use pins a version for one project in .fvmrc; fvm global sets a machine-wide default link. fvm flutter uses the nearest project pin first, then the global version, then whatever flutter is on PATH.
In an FVM project, what do .fvmrc and .fvm/ contain, and how do you point VS Code and Android Studio at the pinned SDK?
basics
~20 s.fvmrc is committed JSON holding the pinned flutter version, optional flavors and per-project switches; .fvm/ holds local links into the FVM cache. VS Code's dart.flutterSdkPath is set by FVM; Android Studio is pointed at .fvm/flutter_sdk manually.
How do you use FVM so CI builds a Flutter app with exactly the SDK version developers pin, including in a repository with several apps?
basics
~20 sCommit an exact version in .fvmrc, then in CI install FVM, run fvm install with no argument to fetch the pinned SDK, and run every step through fvm flutter. In a multi-app repository, each app resolves the nearest .fvmrc.
In FVM, how do fvm spawn, fvm flavor and fvm exec differ from fvm flutter, and when would you use each?
basics
~20 sfvm flutter runs the pinned SDK; fvm spawn <version> runs one command on another version with the pin unchanged; fvm flavor <name> uses a version named in .fvmrc; fvm exec runs any command with the pinned SDK on PATH.
In Codemagic, what is a workflow in codemagic.yaml, and which sections does a typical Flutter release workflow define?
basics
~20 sA Codemagic workflow is one named pipeline under the workflows key of codemagic.yaml, committed at the repository root. It declares its machine, environment, triggers, scripts, artifacts and publishing, so one file can hold separate test and release workflows.
In codemagic.yaml, how does ios_signing, backed by an App Store Connect API key, let Codemagic sign a Flutter iOS build automatically?
basics
~20 sAn App Store Connect API key (Issuer ID, Key ID, .p8 file) lets Codemagic create certificates and fetch provisioning profiles into Code signing identities. ios_signing with distribution_type and bundle_identifier installs the matching files at build time, and xcode-project use-profiles applies them.
In Codemagic, what are environment variable groups, and how should a codemagic.yaml workflow receive secrets such as a Google Play service-account key?
basics
~20 sCodemagic environment variable groups are named sets of variables defined in team or application settings, marked Secret to encrypt them, and imported by name under environment.groups. Binary files are base64-encoded before storing and decoded during the build.
In codemagic.yaml, how do you make a Codemagic workflow build automatically on pull requests into main and on release tags, and skip stale builds?
basics
~20 sCodemagic starts a workflow from its triggering section: events such as push, pull_request or tag, filtered by branch_patterns and tag_patterns and delivered by a repository webhook. cancel_previous_builds and a when block drop stale or irrelevant builds.
For a scooter-sharing Flutter app, how would you set up Codemagic so a version tag signs both platforms and ships builds to Google Play internal testing and TestFlight?
basics
~20 sUse two tag-triggered workflows sharing anchors: Android with android_signing, a store-derived build number and google_play publishing to the internal track; iOS with ios_signing app_store, use-profiles and app_store_connect publishing via the API-key integration. The first Play upload is manual; App Store Connect needs an app record.