So let's get it started!
→ #1 Great package repository (pubdev)
The official package repository for Dart and Flutter apps is supported by Google, and it can be found under pub.dev. Below, I wrote out a few reasons why I think using this repository is well maintained and safe to use.
- At every published package's documentation, you can check its scores & pub points. These allow us to gives more overall knowledge about package quality. That's nice 👍
- Secondly, some packages are provided by fluttercommunity.dev which
is an organization aimed at providing a central place for community-made Flutter packages.
Their goal is to ensure that packages are kept alive and maintained in one place.
- There is also a Flutter Favorite program:
The aim of the Flutter Favorite program is to identify packages and plugins that you should first consider when building your app. This is not a guarantee of quality or suitability to your particular situation—you should always perform your own evaluation of packages and plugins for your project.
- One of the cool things about using pub packages is that they are easy to install and use. In most cases, it is enough to add the package to,
dependencies: http: ^0.13.4
And then import the installed package in your Dart code:
Personally, I have never had a problem installing and using any package from the pub repository. And here is a list of some packages that I almost always use in every Flutter project:
- Launcher icon
- Package info (plus)
- GetX (This one is the most popular package - or rather to call framework? 🤔)
- Dio, Http
→ #2 Work (almost) anytime
This one is crucial for me. I'm working on macOS and I follow this setup installation couple of times (lastly when I'm switch to M1) and it was always work! The process of setup Flutter environment is easy and straight forward. Additionally, if you have any projects that use an older version of Flutter (before null-safety) you shouldn't have any difficulties getting it up and running and there are tons of tutorials and tools to migrate to the newer version.
Furthermore, Flutter provides many very helpful CLI commands such as
flutter doctor, which checks your development environment and display the output to the console. Another very neat commands that can fix a lot of problems are:
flutter clean flutter pub cache repair flutter pub get
Beside above built-in commands during development (I'm using VS Code) some errors could be resolved by restart IDE (some issues with the flutter plugin for VS Code) and ... restart computer (Yes! Always remember to restart computer 😂).
But really, I didn't have many cases that I have to do that.
→ #3 Marvelous documentation & YT channel 😍
I've seen and used many many many documentation for different technologies and languages, but Flutter has (in my personal opinion) the best, here's why.
Besides, you can find chapters like testing, debugging, development, performance & optimization and many more.
If that's still not enough for you, they have a great YouTube channel where you can find series like Flutter Widget of the Week or Flutter Package of the Week which are incredibly helpful, and I use them on a daily basis.
I've also recommended reading articles on the official medium account (new articles often appear as a new Flutter version is released), raywenderlich blog or download the free e-book available on the Flutter website.
→ #4 Impose solutions - NOT
At this point, I'd like to explain how Flutter gives you full control of how you want to build your application. Starting from folder structure, in
lib folder you can implement any architecture pattern you want - MVC, VIPER, Domain driven, with any state management - BLoC, MobX, Redux and with any folder structure e.g. Feature Base, Atomic Design.
Besides, you have full access to Android and iOS folders, which can help you add platform-specific permissions and features to your project.
As you can see, nothing dictates the way you want to write your application.
→ #5 Integration's
I know, not everyone has to be a fun of Google services, but if you use products like Firebase to connect it to your app you can use FlutterFire which allows you to use multiple Firebase services in your app. Long story short you can easily integrate Flutter code for e.g. analytics, crashlytics, authentication and even ML.
Also in one of the latest versions they announced monetization from advertising, in-app purchases and payments!
But there's more! Some UI/UX tools have an installable plugin that generates Flutter code based on your projects:
→ #6 IDE support feature's
Here I will describe the features and plugins that I use that are very helpful in coding. My current IDE is VS Code and a very neat instruction on how to configure it to work in Flutter is written in their documentation, and I highly recommended reading it.
Starting with the two most basic plugins for Flutter and Dart, which provide features such as Syntax Highlighting, Snippets, Formatting, Refactorings and Code fixes (lightbulb) and many, many, many more. It is delightful to be able to fix any errors or wrap / remove a widget with just one click (lightbulb 💡).
Apart from these two, there are many other additional plugins for Flutter and Dart that can be found in the marketplace and installed in your IDE depending on your needs.
→ #7 Dart
One of the cool things about working with Flutter is that we use the Dart language. I will mention just a few advantages of this language, especially the ones that it respects the most:
- Immutability - To help you work with immutability, Dart has the concept of using keywords like
finalfor values that don’t change. So if you know the value at compile time, use
const, but for a variable that cannot be reassigned after being initialization, use
- Syntax - I really like Dart's syntax, especially as it is compact. Dart makers provide many features such as: template strings, optional
newkeyword, arrow functions that I know from the JS world.
- Private identifiers - You can also find
privatevariables in Dart. By default, all identifies are public, but if you want a private (scoped) one you can use an underscore prefix like:
- Nullability - As of Dart 2.12, a new big function starts to play null-safety. So before, if you didn't initialize the variable, Dart set it to
null, but in the 2.12 version and above it throws an error. To work smoother with null values, Dart has several null-aware operators, such as a double-question mark.
→ #8 Build everything you want
I remember when the Flutter clock challenge was announced
Flutter Clock is a skills-based contest offered by Google, including participation by the Flutter, Google Assistant, and Lenovo teams. Flutter Clock challenges you to use Flutter to build a beautiful and innovative clock face application.
When I saw the completion results - how the interfaces that were built in Flutter rendered so smooth, I was shocked 😳
And that leads us to the ability to build literally anything! 😎
→ BONUS One code to rule them all 👑
It's controversial, but still...
If you've interested in Flutter, you've probably heard that it is a multi-platform framework, and you can run a single codebase on mobile, web and desktop devices:
Flutter is an open source framework by Google for building beautiful, natively compiled, multi-platform applications from a single codebase
Initially, Flutter was a great option to developing mobile applications (as a rival of React Native), but not on the web, mainly due to some issues and work in progress. But time has passed and Google has really worked to fix some issues and prove that it can be used for more than mobile purposes.
Thanks for reading ♥️♥️
If this article was helpful, please leave a comment or 👍