DEV Community

Enzo Conty
Enzo Conty

Posted on • Edited on

πŸ’™ #Flutter: Why should you use it ? Pros of the cross-platform mobile framework of Google !

Maybe you are aware of this new contender in the game of cross-platform mobile framework, or maybe you're simply not aware of what is Flutter at all, but in any case we will today speak about how this powerful framework made applications creations a lot easier.

So firstly, what is Flutter ?

Flutter, is a cross-platform mobile front-end framework made by Google, and it was launched firstly in May 2017 !

For the beginners out there that may already be lost: making an iOS and Android app is very time consuming because you need to create 2 completely different project with different language, with Flutter, you don't have this problem anymore, because you only write code once and you will still have an Android app, and an iOS app ! So you're not loosing time (and money) to hire two kinds of developers !

But for those who know a little about cross-platform mobile framework, you know that creating both iOS and Android application with the same code base in not new, Xamarin and React-Native have already done it.
So...

Why should you use Flutter ?

Firstly, because Flutter build native cross-platform apps, so no wrapping, no web app, we are building two reals apps with one programming language, so you don't have to learn Java/Kotlin for Android, and ObjectiveC/Swift for iOS !

Flutter provide an SDK that compiles the code you write in native code for Android and iOS, that's why you only write once your code and with the same codebase also Flutter provide you a front-end framework to quickly and easily build UI.

Demo: two apps one codebase

Why it is better than React-Native ?

React-Native is one of the most used cross-platform mobile framework as I write this article, so why Flutter would be better ?

The answer is hidden on how the Flutter SDK compiles into native code.
Since we're building two different apps on two different platform, you may think that when we create a button with RaiseButton or FlatButton in Flutter, it's "translated" as a UIButton on iOS and a widget.Button on Android, but it's not !

Actually, Flutter controls directly the pixels on your screen and act as a canvas on which you paint element of your UI ! If you don't believe me, I suggest you to see the video of Robert Felker, a french artist using Flutter to create art

And what if I told you that you can do this too ?
The code used to make such masterpiece is only 64 lines of codes !

GitHub logo Solido / flutter-d-art

Generative d.Art with Flutter

Generative d.Art

Demonstrate how to generate your very own #d_Art using Flutter. As a technical point we are NOT relying on Widget but RenderBox directly.

Don't be afraid of those 60 lines of codes & change everything you want (but not the line with Math.Exp, it can damage your computer permanently)

Code is tuned to work on a << TABLET SCREEN SIZE >> so start an equivalent not a phone.

Can't wait to see your Creations on Twitter Post with #d_Art so everyone can appreciate it !

Final Result

Screenshot




And it might be scary to start a languages that's doesn't really have any limitations, but you shouldn't worry about it, because Flutter is one of the easiest language I learned because everything is a widget

What do I mean by that ? Just check this code for creating a button, everybody (even non-technical people) can understand it:

          RaisedButton(
            color: Colors.blue,
            padding: EdgeInsets.all(10),
            onPressed: () {
              print("Button pressed");
            },
            child: Text("Press me !"),
          ),
Enter fullscreen mode Exit fullscreen mode

Here is the result:
Result button

So it means that at the end, you have full control of what's happening on the screen, you can start building complex UI without any limitation !

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.