Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

8664 bites

Page 22

MobX: Automatic UI Updates with Reactive State
Flutter & Dart2 min read

MobX: Automatic UI Updates with Reactive State

MobX automatically wires your reactive data to your Flutter UI, so widgets update when data changes. It's used for state management from simple counters to complex forms. The main footgun is forgetting to wrap all state mutations inside an Action.

Flutter & Dart2 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.

Flutter & Dart2 min read

Freezed: Immutable State Without Boilerplate

Freezed is a Dart code generator that writes your immutable data classes for you. You define the shape, and it generates constructors, copyWith, and equality checks. Use it for model classes and to represent distinct states.

Flutter & Dart1 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.

Flutter & Dart2 min read

Dart's `http` Package: Simple Requests vs. Composable Clients

Dart's http package simplifies web requests. Use top-level functions like http.get() for one-off calls, or a Client for persistent connections. Forgetting to call client.close() is a common footgun that leaks resources.

How do you diagnose and fix flaky Flutter widget tests?
Flutter & Dart2 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.

Flutter & Dart2 min read

JSON in Dart: Using `dart:convert`

dart:convert is Dart's built-in translator for JSON. It turns Dart Maps into JSON strings (jsonEncode) for APIs and file storage, and parses JSON strings back into Maps (jsonDecode). The footgun: jsonDecode returns a generic Map, not your custom class.

Flutter & Dart2 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.

Flutter & Dart2 min read

Manual JSON Serialization with fromJson/toJson

Manually map your Dart objects to JSON by writing your own fromJson and toJson methods. This is ideal for simple data models or quick prototypes where code generation is overkill.

Flutter & Dart2 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.

Flutter & Dart2 min read

FutureBuilder: Handling Async UI in Flutter

FutureBuilder rebuilds UI based on an async operation's state, showing loading, error, or data. Use it for network requests or slow computations. Footgun: Never create the Future inside build; it will restart on every rebuild, causing an infinite loading…

Flutter & Dart1 min read

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.

Flutter & Dart2 min read

json_serializable: Automating JSON in Dart

json_serializable is a boilerplate-writing robot for Dart, automatically generating code to convert classes to and from JSON. It's essential for data models in network requests or local storage.

Flutter & Dart2 min read

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.

Flutter & Dart3 min read

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.

Flutter & Dart2 min read

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.

Flutter & Dart2 min read

dio Interceptors: Middleware for Network Requests

dio Interceptors are middleware for network requests, letting you inspect and modify them before they're sent or after a response is received. Use them to globally add auth tokens, log activity, or handle token refreshes.

Flutter & Dart2 min read

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.

Flutter & Dart2 min read

graphql_flutter: Client Setup and Querying

graphql_flutter connects your app to a GraphQL API via a client-provider-widget pattern. You provide a configured GraphQLClient to a GraphQLProvider, then use Query widgets to fetch data declaratively.

Flutter & Dart2 min read

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.