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 26

Flutter & Dart2 min read

Dart FFI: Calling C Code from Dart

Dart FFI is a bridge to the C world, letting you call native C libraries directly from Dart. Use it to access OS APIs or high-performance C/C++ code. The footgun: you must manually manage native memory, risking crashes or leaks if you forget to free.

Flutter & Dart2 min read

How would you optimize Flutter CI build times beyond caching?

Tests platform build pipeline knowledge and CI design. Answers hit Gradle parallelism and R8 config for Android, Xcode derived data, target thinning on iOS, plus Dart AOT flags and sharding.

Flutter & Dart2 min read

Flutter Add-to-App: Embedding Flutter in Native Apps

Think of Add-to-App as embedding the Flutter engine inside your existing native app, like a super-powered web view. It's for incrementally migrating a large Android or iOS codebase to Flutter without a full rewrite.

Flutter & Dart2 min read

BasicMessageChannel: A Coded Pipe to Native

A BasicMessageChannel is a raw data pipe between Dart and native code that uses a "codec" to translate objects into binary. Use it for streaming data or custom types not handled by MethodChannel. The footgun is a codec mismatch, which causes runtime crashes.

Flutter & Dart2 min read

Background Execution and Services in Flutter

Think of background execution as a helper doing heavy lifting off-screen. It keeps your app's UI smooth by running tasks like data processing on a separate thread (Isolate). The footgun is that isolates don't share memory; you must pass data explicitly.

Flutter & Dart2 min read

Unit Testing in Dart: Verify Your Logic in Isolation

A unit test is a microscope for your code. It checks a single function or class in isolation, ensuring it behaves correctly without worrying about the UI or network. Use it for business logic, not for testing rendered widgets or API calls.

Flutter & Dart2 min read

Dart's `expect` and Matchers: Writing Better Tests

Dart's expect and Matchers are a grammar for your tests, letting you define complex rules beyond simple equality. Use them to verify values, check for exceptions, and test async Futures/Streams.

Flutter & Dart1 min read

Finding Widgets with Flutter's Finder Class

Finder is your magnifying glass for widget tests, letting you locate specific widgets in the tree. It describes what to find, while the WidgetTester does the actual finding. The footgun is assuming a finder returns only one widget when it might match several.

Flutter & Dart2 min read

WidgetTester: Programmatically Drive Your Flutter UI

WidgetTester is a robot user for your app, programmatically tapping, dragging, and entering text. Use it in testWidgets to simulate user flows and verify UI state. The footgun is forgetting tester.pump() after an action; you'll assert against a stale UI.

Flutter & Dart2 min read

Golden File Testing: Visual Regression for Widgets

Golden file testing is a 'spot the difference' game for your UI, catching visual regressions by comparing a widget's rendering to a master image. Use it to lock down critical widget appearances.

Flutter & Dart2 min read

Testing Flutter Platform Channel Interactions

Mock platform channels to test your Dart code's interaction with native APIs without a real device. Use this for unit tests of features like camera or GPS access. Footgun: These tests only verify the Dart side, not that your native code is correct.

Flutter & Dart2 min read

Flutter Build Modes: Debug, Profile, and Release

Flutter's build modes trade performance for developer features. Debug mode is for fast iteration with hot reload, while Release is for optimized user builds. You use Debug daily, Profile to hunt for bottlenecks, and Release to ship.

Flutter & Dart2 min read

flutter analyze: Your Code's First Line of Defense

Think of flutter analyze as a spell-checker for your Dart code. It catches errors, style issues, and potential bugs before you run the app. The footgun is ignoring its configuration; its real power is in a custom analysis_options.yaml file.

Flutter & Dart2 min read

Android App Signing: Your App's Digital Seal

Think of app signing as a digital seal for your Android app. It proves you are the author and the code hasn't been tampered with, a mandatory step for Google Play release. The biggest footgun is losing your private key, which locks you out of.

Flutter & Dart2 min read

iOS Code Signing: Apple's Digital Notary for Apps

iOS code signing is like a digital notary stamp for your app. It proves to Apple you're a trusted developer and the code hasn't been tampered with. It's mandatory for running on physical devices or submitting to the App Store.

Flutter Flavors: One Codebase, Multiple App Versions
Flutter & Dart2 min read

Flutter Flavors: One Codebase, Multiple App Versions

Flutter Flavors let you build multiple app versions from one codebase, like a kitchen making different dishes from the same ingredients. Use them to manage separate API endpoints and branding for dev, staging, and prod.

Flutter & Dart2 min read

CI/CD for Flutter: Automate Your Builds and Releases

CI/CD for Flutter is a safety net that automatically builds, tests, and deploys your app. Use it to catch bugs early and ship updates to app stores without manual steps.

Flutter & Dart2 min read

Flutter Web Renderers: HTML vs. CanvasKit

Flutter on the web draws your UI using one of two engines: HTML or CanvasKit. The HTML renderer uses standard web elements for compatibility, while CanvasKit uses a high-performance canvas for graphical fidelity.

Flutter & Dart1 min read

Flutter Desktop App Packaging: From Code to Executable

Flutter desktop packaging bundles your Dart code into a native executable for users. Instead of just running flutter run, you use platform-specific build commands to create a distributable file, like a .app on macOS or an .exe on Windows.

Flutter & Dart1 min read

Flutter Code Obfuscation: Hiding Your Logic

Obfuscation makes your compiled Dart code harder to reverse-engineer by renaming symbols to be unreadable. Use it in production builds to protect sensitive logic, but always save the symbol map file to decipher crash reports later.