Code Craft
Flutter Performance Tip: The Benefits of Const
When it comes to improving the performance of your Flutter app, sometimes it's not a single big bottleneck bogging things down, but the accumulation of smaller hits over time.
As Gordon Hayes points out here, the use of the "const" keyword is one of those smaller opportunities for performance gains. This is the case both in execution speed and memory use.
And just in case you're having trouble keeping the differences straight between "const," "static," and "final," Gordan also points out this older article from Bob Nystrom, which still applies today.
Fixing Those "Unbounded Height" Errors
If you've been developing in Flutter for any length of time, I'm sure you've run into this one. :-)
Thanks to Filip Hráček for shining a spotlight on the root cause of these errors, and how to fix them.
Tutorials
How to Parse JSON in Dart/Flutter: The Essential Guide
Parsing JSON is something most Flutter devs will need to do at some point. If you're just getting started with Flutter or just want a more solid understanding of JSON parsing, this handy tutorial by Andrea Bizzotto should be helpful.
In this first of his two-part series, Andrea covers the manual process for building your JSON parsing code, with more automated techniques coming in a future part 2.
Tips & Tricks
Reducing Jank on Flutter Mobile
If you're noticing some jankiness with your flutter app, especially when you're navigating between screens the first time a transition runs, you could be experiencing a slowdown due to run-time compilation.
The Flutter team is very aware of this issue, and just in case you've missed it, here's a handy guide you can follow to help reduce the lag.
Architecture
Flutter Architectural Overview
Since getting back to basics seems to be one of the running themes of this issue, there's probably no better time than this week to remind ourselves of how Flutter works, from the ground up, at an architectural level.
As you can see, there is a LOT going on under the hood here. And I for one appreciate the fact that all of this "unseen work" is helping me be more productive in shipping actual value to my customers. Because Flutter has been architected so thoughtfully, I don't have to expend effort working on this foundation, but can focus my efforts at a higher point in the development stack instead.
// From Mark
Honing Your Flutter Dev Skills
Working on the newsletter this week has reminded me that if I'm trying to improve my development skills in Flutter, it's important to not only focus on the "new and shiny" Flutter packages which seem to come out all the time these days, but to also take time to review the basics.
Case in point this week is a tweet from Gordon Hayes (links below), which eventually led me to an article from 2012(!) highlighting the differences in Dart between final, const, and static. Are these pretty basic topics? Sure, but if you haven't yet cemented in your mind when and why you might use each of these, here's your opportunity to brush up.
I also think that if you're reading this newsletter, you should know that my goal with the newsletter is to help us all be better Flutter/Dart developers, even if that sometimes means harkening back to 2012 for a refresher to help solidify best practice concepts. :-)
Mark Winters