Five years of studying architecture, over two years of grinding in the industry, and one devastating thought — Do I want to keep doing this? Was this another period of burnout? I don’t think so. But was something new sparking? Maybe…
Continue reading →Category / Architecture
Flutter: Introducing `url_router` – A simpler Router controller.
When it comes to implementing a url-based Router
(aka Nav2) there are really 2 high-level components to the API:
- A controller to read/write to the current url
- A parsing/matching system to convert a url into a stack of views, or pages.
The interesting thing here, is that the controller portion, is a fairly stable, boring API. Reading or writing the url
location, or accessing queryParams
is all pretty straight-forward. Really all you are doing here is setting a string value, and parsing query params using the URI
class.
Flutter: Adding (scalable) state management to the new `skeleton` template
Recently we took a deep dive into the new skeleton
template included in the Flutter SDK. As noted in the article, one of the big missing pieces in the template is a scalable state management solution with dependency injection and data-binding.
Given that, we thought it would be informative to convert it to use a couple of popular state management libraries, specifically riverpod
and GetItMixin
.
Flutter: A Skeleton App w/ GetIt + GetItMixin
Recently we compared and contrasted some common state management packages. And while app architecture was not the focus of the article, we received some feedback that the examples were too simple to give a good picture of how the approaches would scale. In this post we’ll attempt to address that concern by building a simple yet scalable skeleton app using GetIt
and GetItMixin
!
Get What?
If you’re not familiar with GetIt
, it is a robust implementation of the classic service locator pattern, which allows you to register objects by their type and then look them up from anywhere in the app. Recently it gained a sibling package named GetItMixin
which provides reactive widget binding hooks. Combined these two packages make up one of the simplest and cleanest methods of managing state within a Flutter application. Let’s take a look!
NOTE: To follow along, the full demo is posted here:
https://github.com/esDotDev/flutter_experiments/tree/master/get_it_skeleton_app