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.

4247 bites

Page 14

Flutter & Dart2 min read

Choosing a Flutter Local Persistence Strategy

Flutter offers three main ways to persist data locally. Your options are simple key-value pairs for settings, direct file I/O for blobs like images, or a full SQLite database for complex, structured data. The main footgun is picking the wrong tool for the job.

Flutter & Dart2 min read

Flutter Shaders: GPU Power for Custom Graphics

Shaders are small programs running on the GPU to create custom visual effects. Use them for high-performance graphics like frosted glass or animated gradients that standard widgets can't handle.

Flutter & Dart2 min read

EventChannel: Streaming Data from Native to Flutter

EventChannel is a one-way radio from native code to your Flutter app, designed for continuous event streams, not single method calls. Use it to listen for ongoing platform events like sensor data, GPS location updates, or battery state changes.

Flutter & Dart2 min read

Flutter Widget Testing: Verifying UI in Isolation

Widget testing is like testing a single actor's performance without the full play. It lets you build, interact with, and verify a single UI component in isolation, making it faster than a full app test and more comprehensive than a unit test.

Flutter & Dart2 min read

Mocking Dependencies in Flutter with Mockito

Mockito creates fake, controllable versions of your app's dependencies, like an API client. This is crucial for unit tests, letting you isolate code from external systems to make tests fast, reliable, and independent of network or database availability.

Flutter & Dart2 min read

Generating Code Coverage Reports in Dart

Code coverage shows which lines your tests execute. It's a health check for your test suite's reach, not a measure of code quality. Use the coverage package to generate reports for CI/CD. The footgun is that high coverage doesn't prove correctness.

Flutter & Dart2 min read

Flutter for Web: Build and Deploy

Flutter for Web compiles your Dart code into a web app. Use flutter build web and choose a renderer: HTML for smaller size or CanvasKit for performance. The footgun is the initial download size, which can be large and slow down first-page load.

Flutter & Dart2 min read

Flutter's `compute`: Offload Heavy Work from the UI Thread

Flutter's compute function runs heavy calculations in the background to prevent your app's UI from freezing. Use it for tasks like parsing large JSON or complex math. The footgun: on the web, it runs on the same event loop, not in a true parallel thread.

Flutter & Dart2 min read

Flutter Nested Navigation: Routers Within Routers

Nested Navigation is like having a mini-app with its own back button inside a single screen. It's used for UIs like a BottomNavigationBar where each tab needs its own navigation history. The footgun is calling the wrong Navigator's context.

Flutter & Dart2 min read

Performance Profiling in Tests

Performance profiling in tests means capturing frame build and raster times during a scripted, automated run instead of eyeballing smoothness, so jank regressions get caught in CI before they ever reach a real device.

Flutter & Dart2 min read

Classic BLoC with Streams and Sinks

Classic BLoC separates UI from business logic by exposing inputs as Sinks and outputs as Streams. The widget pushes events into sinks, the BLoC processes them, and emits new state on streams that the UI rebuilds from, keeping logic testable and…

Flutter & Dart2 min read

Flutter Network Errors: Fail Gracefully

Treat every network call as a promise that might break. In Flutter, catch exceptions at the HTTP boundary and map them to UI states like retry widgets. The footgun is letting Dio or http exceptions bubble up, crashing the app instead of degrading gracefully.

Flutter & Dart2 min read

Repository Pattern: Hide Your Data Sources

A repository is a contract that hides where your data lives. Your Flutter app should not care if a user profile comes from Firebase, SQLite, or a mock. Engineers often leak HTTP clients or database models into UI instead of returning domain models.

Flutter & Dart2 min read

Legacy Integration Testing with flutter_driver

flutter_driver remotely pilots your app from a host via Dart VM service, common in legacy codebases with host-side scripts. Do not treat it as an in-process widget test because it runs outside the app; you cannot inspect state or use flutter_test matchers.

Flutter & Dart2 min read

Tree Shaking Removes Unused Flutter Code

Tree shaking is the compiler deleting code your app never calls, so importing a massive package only costs the pieces you use. It runs automatically in release builds. Relying on dynamic dispatch or dart:mirrors silently disables it and brings back the bloat.

Flutter & Dart2 min read

Flutter Performance Overlay

Flutter's Performance Overlay is a real-time EKG for frame budgets. Two graphs reveal whether Dart UI work or GPU rasterization is causing jank during animations. The footgun is rewriting widget logic when the raster thread is actually the bottleneck.

React Components: Your UI Building Blocks
React & Next.js2 min read

React Components: Your UI Building Blocks

Think of React Components as custom, reusable HTML tags you create with JavaScript functions. Use them to build everything from buttons to page layouts, speeding up development.

JSX: Putting HTML Inside Your JavaScript Components
React & Next.js2 min read

JSX: Putting HTML Inside Your JavaScript Components

JSX is a syntax extension that lets you write HTML-like markup directly inside your JavaScript files, keeping UI logic and structure together. It's the standard way to define a React component's output. The footgun is that JSX is stricter than HTML.

React Props: Arguments for Your Components
React & Next.js2 min read

React Props: Arguments for Your Components

Think of props as arguments for your UI components, letting you pass data from a parent down to a child. You use them to customize a component's appearance or behavior, like passing a user object to a ProfileCard.

React Fragments: Group Elements Without a Wrapper
React & Next.js1 min read

React Fragments: Group Elements Without a Wrapper

React Fragments let you group multiple elements without adding an extra <div> to the DOM. Use them when a component needs to return adjacent elements, like table cells (<td>).