Summary
In this chapter, we reviewed an advanced concept – working with the native layer. We observed the architecture of the Flutter application, the responsibilities of each layer, as well as how the client (Flutter) and host (native) are connected via platform channels. We implemented a Favorites feature on the native side via the MethodChannel
API, which highlighted the downsides and potential problems of this default approach. Then, we learned how the pigeon
code generation tool solves these problems by ensuring type safety and reducing the amount of boilerplate.
This is the final chapter of Part 3, which means that at this point, you should be well equipped with solutions and battle-proven approaches to a broad set of Flutter problems. In Part 4, the final part of the book, we will learn how to test the code that we have written so far, as well as what other options we have for ensuring and maintaining the code quality of our applications. We will start with Chapter...