Flutter is a cross-platform, open-source, and free framework for creating mobile applications, created by Google. It is very easy to learn and currently it is getting more and more popular.
When I used Flutter first time, it makes me feel amazing! Because I can just use the visual code for development, and it’s easy to create a beautiful layout, there are many of widgets that can help to create the layout!
As my thoughts before, I think how to handle and create the layout is very important with a cross-platform app framework, because you need to make sure your app can work fine in difference platform and resolution, Flutter can provide a good solution for that, and there are many of existing layouts for your reference, also, you can this tool for easy to create the layout or convert the app design from Sketch.
Another thing I like is the animations! Yes, you can easy to create more wonderful animations in Flutter, and some of them are build-in in the framework, so you just need to write a few codes and can let it works. And the animations built with Flare can be embedded into an existing Flutter app as a widget, this is a very powerful skill! And this is Google’s child, so it can good for support most of google’s services!
But, after I tried for several months, I have found some problems, and these problems let me have to give up the Flutter!
Flutter uses the dart language, it’s not a real multithreading language, so you can’t execute the background tasks very well in Flutter, although there are some plugins for this, but it can’t handle on iOS as well, if you want to execute the background tasks on iOS, you will can’t control when it will execute, and for my testing, I never find the task has been executed on iOS, it disappointed me 😫
Because everything is widget, and most of the times you will easy to nested the widget again and again, so you will find your codes in a mess, also, if you can handle this carefully (don’t nest the many of widget and try to separate them to another small function) maybe can avoid this issue, but maybe most of the times you will want to fast to let your codes running (like me?😅), you will forget to separate them!
Maybe Flutter is still newer, so there are some limitations to handle some native functions. For example, if you want to add photos into a PDF file, you will find that’s not easy to do, I used this plugin for that, but I found that can’t handle the photo very well, it will lower resolution of the photos and seems can’t solve. Another example is difficult to handle the GPS data, I can get the current user’s Lat/Lng information, but it will cause a serious performance issue, I don’t know why😕.
I really don’t like event handler logic (state management logic)! Maybe I just got used to defining the events like javascript/java or c#, for example with a button click event, you should define a button and create it clicks event as below on C#:
button.Clicked += button_Clicked private void button_Clicked(object sender, EventArgs e) { //change the text box value TextBox.Text = "New Value"; }
this will be very smooth, but in Flutter, you can’t do that, you need to define the click event on the flow, and use the setState to refresh the layout or widget, if I need to change the text box value, I need to do as below :
//global var var textValue = ""; //the label value Container( child: Text( textValue ), ); //click event GestureDetector( onTap: () { setState(() { textValue = "New Value"; }); }, ),
Another problem for me, Flutter uses many async/await (Future) for get the data. For example, if you want to get data from SQLite or other database or network, it must be use the Future method, I know this should be a good solution and let the UI response smooth, but I just feel this is difficult to handle the return value, maybe I should use some design patterns(such like BLOC, Redux…), but I also feel to use these 😕
And for database I/O performance issue, I don’t know whether this is my codes issue, when I try to insert hundreds of data into SQLite DB at the same time, it will be very slow, I have tried to group the data into a List object and insert at one time.
So, the above are just my personal opinions, I just feel the Flutter is not suitable for me, but maybe it still can fulfill your requirements😄