Cross-platform software development toolkits are gaining popularity among many developers. And one of the most popular SDK for cross-platform is Flutter. It’s an open-source framework powered by Google that was published in May 2017. In a nutshell, it enables you to develop a native mobile app from a single codebase. This means you can construct two apps using the same programming language (for iOS and Android). That’s also the reason why startups often decide to choose this tech stack.
I’ve written this article to share some advice that I’ve learned during my Flutter development.
1. Know your widgets
As you’ve probably heard, Flutter is all about widgets. In fact, we have billions of widgets in Flutter (so maybe not that much… but still a lot). Some of the solutions we can achieve in multiple ways. Let’s say, I have a list with items and want a line between each item. There are two simple solutions to this problem:
- Use Container – container is one of the most basic ones that we have and we can do multiple things from it. But there is a better way!
- Thanks to our Flutter developers, we have available to use Divider – this widget has only one job (be a divider) and does this as best as it can! In Flutter, we can have multiple situations like this and in most cases is better to use a built-in object than make our own.
2. Know your IDE (not only for Flutter devs!)
IDE is our main Flutter tool to work – it’s like a car for drivers. The better you know your IDE (its shortcuts, extensions, sometimes weird behavior), the better and faster you are.
If you are a developer (if not, it’s hard to explain), I can bet that you are sometimes into programming. You start to think like a computer and the computer starts to think like you. You and your keyboard are one body, there’s nothing more than you, keyboard, and screen. You don’t see the code… you are the code. You feel like this guy from the Matrix that doesn’t see 0101010 but sees images, people, cars. You feel connected like Toruk (this flying thing) and Jake Sully from Avatar. You feel like you didn’t choose to program but more like programming did choose you! But then, suddenly! You have to grab your computer mice and nothing more is the same. Ok. This may be a little bit too dramatic.
The point is to know keyboard shortcuts. It’s a small thing but really can help you to feel like (and be!) a better developer.
3. Flutter Extensions for IDE
This is a little bit connected with the previous one. Extensions and plugins in Flutter are useful as they can add some missing features to your IDE that help a lot. If you use Android Studio (like me!) and code in Dart programming language, you already use plugins. My must-haves are:
- Bloc (if you use bloc package),
- Flutter Intl (if you use intl package),
- Rainbow Brackets,
- and FlutterAssetAutoCompletion.
These are Flutter plugins that I can recommend from my heart and can bet that you won’t regret installing them.
4. Use packages
The Flutter community is one of the best in my opinion. Thanks to that, we have multiple packages that can help us code our mobile apps and make them faster than ever. After all, we don’t want to reinvent the wheel. It’s hard to recommend any packages because there are so many of them and most of them are so good and useful that it’s hard to choose! They also depend on the Flutter app you would like to build. All of them you can find here!
5. Nullable .?
For not that long, Dart supports sound null safety. For me it was a game-changer and to be honest, it should be for you too. Sound null safety may be frustrating at the start but believe me and Dart developers who decided that this is a good idea. After all, it will save you so much time on debugging mobile applications as well as fixing NullPointerException that it’s worth giving a shot. More about that you can find on the documentation here.
6. Dart features
Again, this will be connected with the previous advice. Dart is a really cool language that has a lot of tricks that can help you write less code while making it better. For example, you have a function that can be null and you can’t use it like this ‘functionX()’? No problem! Just use ?.call()! Now the function will be called if it’s not null and it won’t crash if the function will be null! In Dart, we have more tricks like that!
7. Breathtaking designs
Flutter is also well-known for its beautiful UI designs and animations. Some of them are really hard to make, or at least they seem to be. Flutter can work with other tools (like Rive) and thanks to that we can make animations look amazing! But that’s not all. In Flutter, just out of the box, we can make animations that look astonishing, and to be honest it’s not that hard. Marcin Szałek is also a Flutter developer that can help you understand these Flutter animations and show you how simple they are when it comes to mobile app development.
Do you want to find out more about Flutter app development?Talk to us!
Become a Flutter Developer
If you want to save your resources and time (compared to iOS and Android native development) while providing an attractive UI and reaching the widest possible audience, consider Flutter development. Right now there’s a demand to hire Flutter developers as Flutter is a relatively young technology. You can check out what top interview questions for Junior Flutter Developer look like on our blog.