Never miss a beat

Join my newsletter.

The Archives

Boxing things in Rust

Published: 9/16/2021

Rust's memory management can feel a bit intimidating for most developers. Rust gives you some control over whether you're allocating data on the stack or the heap and its up to you to decide where memory should be allocated. When you allocate memory for values in Rust, that memory is allocated on the Stack . Memory on the Stack is allocated in a "stack frame" which contains information for the Stack's local variables and some metadata about that stack frame. When a function exits, that…

Flutter's LayoutBuilder Widget

Published: 6/7/2021

Flutter's LayoutBuilder Widget is a widget that allows you to adapt children widgets based off the constraints that the LayoutBuilder is contained in. This allows you to layout widgets differently in different sized containers (like a phone screen vs a tablet screen), but LayoutBuilder also allows you to change how widgets render based off the container that they're rendered within. A good example of the later is rendering a list of items as a list when the container is taller than 500 dp, but…

Dart Mixins Guide

Published: 4/24/2021

There are a lot of alternatives to inheritance. Abstract classes, interfaces, some languages have "traits", and in Dart, we have Mixins (and abstract classes and implicit interfaces, too). Mixins are a way to reuse class code in multiple class hierarchies. How do you declare a Mixin in Dart? Mixins require using 2 different keywords to fully make use of them in Dart. First, we use the mixin keyword to declare a new mixin. Our mixin can then be applied to other classes using the with…

Level Up by Learning How to Ask Questions

Published: 3/11/2021

There are several differences between junior and senior developers, but one of the most noticeable differences is around how they communicate. In development, questions are one of the most common forms of communication. Here are some tips that I have to help you ask senior-level questions. Ask a question. This one might seem obvious, but if you're looking for an answer, start by asking a legitimate question. "My code doesn't work" is not a question. "How do I make this code work?" is better, but…

Reusable SimpleDialog Bodies in Flutter

Published: 1/17/2021

SimpleDialogs are an insanely simple way to display immediately actionable items while conforming to the Material Design specification. They're recommended for use when you need a flexible dialog that doesn't leverage text buttons. Take a moment to familiarize yourself with the Material Spec for SimpleDialogs and once you're back on this tab, we'll dive into their implementation specifically for Flutter. SimpleDialogs in Flutter Alright! Welcome back! SimpleDialogs in Flutter are actually…

How to query flutter dimensions with MediaQuery

Published: 12/24/2020

One of the key selling points for building Flutter applications is the framework's options for building responsive mobile applications. However, it's easy to find yourself overwhelmed by the many options that are available. Often times, you'll want to leverage BoxConstraints, LayoutBuilder, AspectRatio, FittedBox or maybe even the rare FractionallySizedBox. You might even be able to keep things simple by sticking to Flex widgets. However, you'll likely find yourself in a predicament where, for…