• Dependency Injection in Flutter

    • Tutorial

    We’re currently experimenting with Flutter while developing our side project for step challenges with colleagues. This side project should also be considered as a playground, where we can check if we can use Flutter in more serious projects. That’s why we want to use some approaches there that can look like an over-engineering for such a small project.


    So one of the first questions was what can we use for dependency injection. A quick search in the internet revealed 2 libraries with positive reviews: get_it and kiwi. As get_it turned out to be a Service Locator (and I’m not a fan of this pattern), I was going to play with kiwi, which looked more promising, but then I’ve found another one library: inject.dart. It is heavily inspired by Dagger library, and as we use the latest one in our other Android projects, I’ve decided to dig into it.

    Read more →
  • Flutter app architecture 101: Vanilla, Scoped Model, BLoC


      (originally published on Medium)


      Flutter provides a modern react-style framework, rich widget collection and tooling, but there’s nothing similar to Android’s guide to app architecture.


      Indeed, there’s no ultimate architecture that would meet all the possible requirements, yet let’s face the fact that most of the mobile apps we are working on have at least some of the following functionality:


      1. Request/upload data from/to the network.
      2. Map, transform, prepare data and present it to the user.
      3. Put/get data to/from the database.

      Taking this into account I have created a sample app that is solving exactly the same problem using three different approaches to the architecture.

      Read more →