r/FlutterDev • u/always_afraid • Dec 27 '21
Discussion I am not enjoying Flutter
Nobody Likes a rant, but Flutter is the one tool where every time I want to learn a little bit more... it pushes back hard. "No stay it your lane! Make simple little GUI stuff! Don't try to get fancy!"
Here is my abbreviated list of pain points.
1.) As they update Flutter, they keep introducing changes that break old code. If you want to google a working example, you presently have to filter for things written April 2021 or later. Anything before that won't compile. And then you end up trying to explain to the sample code how things work rather than the other way around.
2.) The Flutter community is small and too spread out. The flutter pages list 9 different places where you can get help with questions (including here) the problem is that none of those locations has the critical mass needed for the whole thing to work. There are more un-answered Flutter question on Stack overflow than ones with answers. If you ask about a unique edge case, non-one knows the answer... because there are probably only 6 people who encountered that exact same issue and found a solution.
3.) Way too much core functionality has been left out, hoping that community contributed packages will pick up the slack (Background services?). While the process of adding packages is very user friendly... there is almost zero policing of the published packages. There are hundreds of packages that are not being maintained and do not work with the current version of Flutter. So now everytime I import a package I need to wonder: Will this package still be around in 6 months? Am I setting myself up for some serious pain down the road? All I have to go by: How recently was it updated, how many likes does it have?
4.) Flutter/Dart feels like a project run by the kind of people who will ask you to invert a binary tree during and interview... even though their company doesn't use trees in any project. By that I mean: it feels unnecessarily complicated. Who thought Navigator 2.0 would catch on, or JSON -> Object in 4 non-easy steps was perfectly normal. And it's getting worse, didn't buttons used to have a simple color: property... and now you need to write:
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(Colors.blue),
), ...I still use Flutter, I still intend to use Flutter in the future. But I'm not enjoying it.
35
u/kiwigothic Dec 28 '21
Not adding much to this conversation but FWIW I've been coding in flutter full time for quite a while now (and previously worked with other cross platform frameworks) and I really have to disagree on most of this.. if you compare the flutter ecosystem with competitors like React Native then most of your pain points are the same or worse (sometimes much worse).
Null safety was a challenge for sure but it also weeded out a lot of abandoned packages (not something unique to Flutter at all), I find the "likes" system along with the Null Safety filter to be quite helpful. Apart from that I have not had many issues with breaking changes over the last couple of years.
There are the odd deprecations that can be annoying but it's really a sign that the ecosystem is alive and healthy, Dart is continuing to improve at a very rapid pace which is good for everyone.
Of course it's not perfect (I agree with comments about MaterialStateProperty being weird for instance) but on balance I honestly believe Flutter is leagues ahead of any other cross platform technology and likely to increase that lead.
Overall I find Flutter to be a joy to use.
8
21
u/ShawnMilo Dec 27 '21
That sucks. But Flutter is still in the "early-enough" days that you can be a big player. You know -- the kind of person who writes Flutter books, gives Flutter talks at conferences, offers Flutter training, or has a popular Flutter blog or YouTube channel.
Obviously not today, but as you fight your way through the BS to "get there," you'll be prepared in a way newbies will be unable to duplicate because you did it "the hard way."
Everyone who is a "big name" in whatever technology (insert programming language, framework, automation system, etc. here) is someone who got involved early.
I know it doesn't solve (or even address) your problem. But you can make a positive out of a negative.
5
u/dancovich Dec 28 '21
Apart from migrating to Flutter 2 (that was a annoying) I don't recall any update inside the same major version that broke anything. Maybe you mean a package got updated? Also, just run
flutter downgradeand set your SDK to whatever version you need for it to work.I don't know what difficulty you're having. Both this community and r/flutterhelp are very helpful. Can you give one example of question that you never got an answer to?
What do you consider core? I don't know of any feature Dart misses and Flutter has everything I consider core to an UI framework (which is what Flutter is). Any functionality that works differently depending on the platform (camera, Bluetooth, GPS and so on) NEED to be on a package because these functionalities sometimes differ in implementation depending on the platform.
Changes are necessary if you want your framework to stay with the times. Native Android changes all the time. iOS had an entire language change from Objective C to Swift (I know, you can still use ObjC, but more and more components are written in Swift and require it), React introduced a whole new concept of hooks (which some components annoyingly use exclusively, requiring that you use them too because they don't work with classes) and so on.
And it's not like you were left with your hands hanging. Navigator 1.0 still works - Navigator 2.0 isn't even an update, it's just a badly named different API to deal with the same issue. You can still use 1.0 with no deprecation warnings.
As for the button, they dedicated an entire page to explain the change. It's here: https://docs.flutter.dev/release/breaking-changes/buttons. As a general guideline, you can just use TextButton.styleFrom() to stylize your buttons, it's very similar to the old way.
There are not that many breaking changes in Flutter. Navigator isn't breaking (old one still works, isn't deprecated and probably won't ever be), so they usually write articles explaining the reason of the change when the changes are breaking. They also post it here, so I recommend you visit this sub to stay informed.
I still use Flutter, I still intend to use Flutter in the future. But I'm not enjoying it.
It's ok to not be enjoying it, but your reasons depicted here feel strange to be, because you didn't really gave any examples that wouldn't happen in any other framework. All mobile and web frameworks I know of have these exact issues - even the "seek help" issue happens in frameworks considered popular, because as these evolve old answers get outdated with no info of what the alternative is. I daily lose considerable amounts of time seeking the CORRECT answer for a React question, because answers spread around are outdated or not the best advice for today's standards.
18
u/ObsceneElbows Dec 28 '21
break code? i mean, ive been using flutter for a few years now. Null safety update did not break things. Buttons update did not break things. Sometimes it updates but its not usual to break, in my experience (not considering package updates)
agree, but that matures with time. and i believe flutter is growing fast
you probably should to use few packages on your projects because its "bad" to have many dependencies. thats not flutter exclusive, tho. but the packages that you really need (like state management and some other things) are pretty solid already
the button style update was kind of weird. i think they are trying to change how you do style on apps (still better than anything like css). but MaterialStateProperty is very weird. it doesnt even feel like flutter
5
u/dancovich Dec 28 '21
For point 4, the change had two objectives:
They want to standardize how themes are defined on ThemeData. Before some properties were specific (like having a
scaffoldBackgroundproperty directly inside ThemeData) while others were instances of[ComponentName]ThemeData, with specific properties regarding that specific component. They want to changeThemeDataso ALL specific properties are inside these [ComponentName]ThemeData classes, so instead of having a property scaffoldBackground, they have a property scaffoldTheme that is a ScaffoldThemeData and that class has the background color for Scaffolds.For buttons, unfortunately the old components were too stuck in this old way of thinking. Changing them would break too much, so to not make it a breaking change they deprecated the old components (but they still work) and created new ones following their new philosophy.
2) Buttons didn't have an easy way to customize some aspects of it. For example, it wasn't possible to have a button with different colors for it's states, it always followed Material Design, that always use the same color but with different shades depending on state. The new buttons allow you to not follow Material Design if you don't want to.
2
u/L0G1C_lolilover Dec 28 '21
U can choose to not use materialstateproperty way you know
I think there was another way to style buttons like old
Its called .styleFrom property
3
u/Only-Split82 Dec 28 '21
I disagree to all points you mentioned. Community is big and you can find solutions to everything. But I think you just have too little experience in development in general because if you need examples to understand how something works is really low skill. The best documentation is still the code of Flutter itself. No need to google somewhere. And maybe it lacks some features but try React Native ( the biggest competitor in the field ). Almost all freatures of it are third party... And come on, you are seriously crying because a Flutter update breaks your code???
7
u/eibaan Dec 28 '21 edited Dec 28 '21
I might come from a different background. I started with GUI programming in early 1990 and for me, Flutter feels quite natural and I really enjoy that I can have a look at the complete source code. I was used to this "last century" when using Smalltalk or Java and missed that while working with UIKit (I'm more familiar with iOS than with Android which always felt inferior to me).
Because of my background, I also appreciate the "binary tree during an interview" mindset and actually believe that developers should know common algorithms and patterns and not rely on finding them somewhere. That button example is annoyingly cumbersome, I agree, but very similar in how Android does it and I couldn't come up with a better approach myself. So I accept it.
I don't feel that Flutter often breaks. Quite contrary. It's remarkable stable and as Hixie mentioned, I'm all for changing code if this will improve project. I really hated Java's approach in never ever removing deprecated methods. I prefer Apple's approach to lead and expect that developers will follow. BTW, there's dart fix which helps in migrating code and it is my understanding that the Flutter team will use this (or already use it) to make changes easy to apply.
I feel the same regarding the quality of 3rd party libraries. I'm trying hard to minimize the number of dependencies in my projects and tend to do it myself (I'm talking for my team here, I don't have to do everything on my own, I have people for that ;-) before reading through unknown code of unknown quality that might be unsupported next month.
Actually, I'd wish that the core framework (or 1st party plugins) would still expand as it did a year or two ago. I miss that warm feeling of finding new goodies every month or so. I'd really appreciate an official tree view and/or tree table widget, for example. Or native popup and pulldown menu support. Or multiple document windows. Or 3D graphics support.
I am also impatiently waiting for a solution in Dart for if let, pattern matching or destructuring assignments.
7
u/Hixie Dec 28 '21
The
dart fixfeature is pretty new, but yeah, we're really leaning into it now. (We don't consider something thatdart fixwill automatically fix to be a breaking change, for example, even if it would otherwise break the code in theflutter/testsregistry -- part of running those tests is to first rundart fixon the code.)I still find
dart fixmagical. :-)1
u/eibaan Dec 28 '21
It's inspired by go fix, isn't it?
2
u/Hixie Dec 28 '21
Not sure. In practice it's just a command-line version of what we've had in the IDE plugins for a long time -- the IDEs used the Dart analyzer's logic to offer "quick fix" menu items, and
dart fixjust applies that at scale to your entire codebase.3
u/eibaan Dec 28 '21
To me, the more interesting aspect of
dart fixis, that any author of any package can provide afix_data.yamlfile which is then picked up by the tool and it will offer to perform AST based refactorings. Unfortunately, this feature isn't officially documented yet.3
u/Hixie Dec 28 '21
Yeah I think the team is worried that if they document it before they are confident it's well designed, they will end up stuck with a bad language. Which would be especially ironic for the language that's intended to help with the exact problem. :-)
4
u/snrcambridge Dec 28 '21
This feels like a gripe of someone recently frustrated with some very specific changes. Flutter is excellent. The tooling is amazing, the docs are amazing, the whole premise will set the tone of the next few decades of cross os UI development. We are developers, our life is suffering at the hands of deprecation and versioning, it's the cost of being in such a dynamic and advanced field.
2
u/yes_u_suckk Dec 28 '21
I like Flutter but I agree with every single thing you said here.
Flutter has MANY problems and annoying things that make the development not fun, but I'm hopeful that it will get better eventually since it's relatively new.
3
u/AlexandrFarkas Dec 28 '21
I have been working with Flutter for 2 years now (in production). And it's an absolute joy, comparing to other tech stacks I worked with.
Probably, I just don't have these problems.
Incremental breaking changes is a key to progress.
I've already passed through that stage, where I needed help concerning Flutter. Now it's mostly native parts.
I just write my own package (without publishing), as if I would do it in native. Native SDKs are always available, bridgings through platform channels is easy.
Router is only needed if you support web (personally, I was never asked to build web, 'cause it's not much stable). Also, there is plenty of different abstractions over Router (beamer, routemaster, go_router, which are marked as Flutter Favourite).
3
u/svprdga Dec 28 '21
It's OK if you don't like it. Move on to another technology that makes you feel comfortable.
3
u/ankmahato Dec 28 '21
Let me talk about point #3
Can you quantify .. "way too much" core functionality has been left out.
Actually thats the whole point of having packages - to augment the core, and this is irrespective of the programming language or framework. I am a python ecosystem contributor and publishing a python package to pypi is no different - adding a package is super easy, zero policing of the published packages, "thousands" of packages that are not being maintained and do not work with the current version of Python. And remember Python has been there for nearly three decades now. Still every-time you use a python package you will have the same risk: "Will this package still be around in 6 months? Am I setting myself up for some serious pain down the road? All I have to go by: How recently was it updated, how many github stars does it have?"
So kindly do not question the Flutter community contributed packages in particular. The risks are same across any ecosystem.
To ensure minimal risk and quality there are programs like Flutter Favourites & Flutter Community and sites like Flutter Gems which makes sure there is some vetting of Flutter packages. So you can definitely take a look at these links.
11
u/Hixie Dec 28 '21
It's true that other package systems have similar problems, but that doesn't mean it's not a real problem. OP is totally right IMHO that figuring this out is something that makes Flutter (or Python for that matter) less fun.
3
u/ankmahato Dec 28 '21
Thank you for your comment and your contributions. Sure would be eagerly looking forward to how Flutter will solve this problem and make it more fun.
3
2
u/esDotDev Dec 28 '21 edited Dec 29 '21
Such a hard problem to solve, I'm not really aware of any stacks that have this solved. Unity does the best job here, by having an active market of paid plugin developers, but it's still not perfect, and things very much still get mothballed.
I guess google could just hire like 6 engineers, who do nothing but native plugins all day, every day, year after year. That seems like the only real way to tackle it head on. Obviously very $$$ for the parent company though.
Flash had this solved for a while before it was killed off. With Adobe AIR, and a legion of paying developers, a couple of shops cranked out quality plugins for reasonable prices and sold them in droves. Looks like they are still in business, which is pretty wild: https://airnativeextensions.com/ https://www.milkmanplugins.com/air-native-extensions
1
u/ankmahato Dec 28 '21
"Alphabet, which doesn't pay a dividend at all is sitting on cash and investments of $168.5 billion. That's more than 6% of all the S&P 500's cash in the hands of a single company. And it just keeps piling up. Alphabet's cash pile is 7% higher now than it was in 2020." - Link
Actually, it makes me sad whenever any member of the Flutter team tells its users that they do not have resources to look into something. I think the problem doesn't lie with not having resources, but with the parent company not investing enough in a technology which has gained a lot of traction and has a huge potential.
3
u/Hixie Dec 28 '21
The way capitalism works is that you end up with a lot of money if what you spend your money on is what gives money back. "Invest" is a process where you put money in to get money out. The amount of money a company will invest in open source is proportional to the amount of money they will make in return.
A company might make money from open source via the good will they engender in the community (this is similar to why companies contribute to charities or pay for services in their local town).
A company might make money from open source because they benefit from the product itself in some way (e.g. Flutter saves people money by letting them be more productive than other SDKs).
A company might make money through indirect processes (e.g. when I worked on the web at Google, it was because making the web better would lead to more people using the web which would lead to more ads being shown which would mean more Google ads which means more money for Google).
Google does invest in Flutter (to the tune of dozens of engineers and other roles, and that's not even counting Dart and Skia which are other open source projects that Google funds), and that investment is proportional to the expected return. Other companies (like Microsoft and Canonical) similarly invest in Flutter, and I'm sure their investment is similarly proportional to the return they get.
But if you want companies to invest in open source more than they are currently investing, you have to show how they're going to get a return on that investment. This isn't unique to Flutter or Google, it's true of all companies and all open source. (It's why a lot of open source is funded by non-profit foundations... though they are equally limited by how much money they actually have.)
1
1
u/alok1141 Dec 28 '21
Try Phonegap then. It's easier to work on because everything can be done using HTML, CSS and JavaScript. Disadvantages- It is very hard to design cool and responsive UI in Phonegap.
1
u/laooz Feb 05 '22
I liked Flutter but, coming from web, I missed using markup and style sheets for designing the UI.
So I developed ezFlap, a library that allows to use markup and other features inspired by Vue - in Flutter.
Check it out :) https://www.ezflap.io/
1
Dec 28 '21
Bro, you should just use React. I don’t think early adoption is for you.
3
u/Hixie Dec 28 '21
I think using React is a fine choice, and would definitely encourage people to try both Flutter and React (and other solutions) and pick the best one fr their needs.
That said, I wouldn't describe Flutter as "early adoption" any more. We're well past v2. React first version came out in 2013, Flutter's first version came out in 2015 (with work in public since 2014). React's first post-0.x version was in 2016, Flutter's 1.0 was in 2018.
2
u/solohelion Dec 28 '21
This will be out of date but not too out of date: I switched from React native to flutter on a project, because every time I let my RN project sit a month untouched, when I came back, everything was broken with no code changes (I suppose I ran an update every time). And the errors with expo (which I was using) were basically “something is wrong somewhere, lol”.
0
u/supa_nagasaki Dec 27 '21
Same here I am working on a project and cannot update as it breaks the entire code base causing my team massive problems and have to keep to an older version
5
u/OldHummer24 Dec 28 '21
What kind of project is this? I have a huge project and it takes a few minutes to migrate each time
5
u/Hixie Dec 28 '21
See my other answer for more details, but in general I encourage you to use our tests registry (https://github.com/flutter/tests). We guarantee we will not break code that has been submitted there.
-4
u/Erxio Dec 28 '21
My biggest pain with flutter: I miss something like scss or sass for styling my app. A separate stylesheet where I can make changes as I wish on the basic propertiers of all widgets. I believe that there are some projects with a similar goal in mind but I would prefer a native solution here.
7
u/Hixie Dec 28 '21
Does
ThemeDatanot work for you there? Or do you need a mechanism to classify different widgets with different "classes" like in CSS?(If the latter, you may consider creating yourself a widget that is basically a wrapper around Theme that picks the "right" ThemeData for the section, which you would use something like:
ThemeByClass(name: 'myclass', child: ...)...and it would just insert the
Themewidget into the tree at that location based on aMap<String, ThemeData>or something.edit: or, more efficient even, just skip the string thing and just have constants for each type of ThemeData you want, and just use
Theme(data: myGreenTheme)or whatever, whenever you want to change the "class".3
u/dancovich Dec 28 '21
Well, the main theme you pass to your MaterialApp is your style sheet.
Flutter follows the philosophy that, no matter what you are declaring (UI, stylesheet, config file) you should declare it with code, different from other languages that use XML or JSON for configuration files or style sheets. The reason is that it makes the language the source of truth, the one thing you need to learn to do anything with the framework. For Flutter that's not entirely true (you still need to know YAML for example) but compared to something like React this philosophy does hold up.
It's not a better philosophy or anything, it's just what Flutter went with. For a new framework trying to find it's space, I do understand why they don't wanna force people to learn 6 different languages to solve one issue.
605
u/Hixie Dec 28 '21 edited Dec 28 '21
Hello, Flutter TL here. Sorry to hear you're not enjoying using Flutter. In general I would encourage you to file bugs for your pain points, especially the more actionable ones.
Re the ones you listed:
1: I originally planned to have a "no breaking changes ever" policy for Flutter, but we got a huge amount of push-back from the community at large (as mostly represented by the quarterly surveys you may have seen). The majority of the community (by quite a large margin) was really eager that we continue to break things anytime we thought we could improve them at the same time. So that's why we're breaking you all the time. (I come from a web background, where we were super paranoid about ever breaking anything because a web page from 1992 should keep working now thirty years later, so this was a big culture shift for me, frankly.)
We do have a solution here though. If you submit your tests to our tests registry we guarantee that we will not break your code (or at least that we will submit patches to fix it if we do). I personally use this for one of my projects that I wrote three years ago, and the result is that it still works today even though I haven't touched it in two years.
Even if you can't contribute your own code (e.g. because it's proprietary) you can still submit the tests for the packages you depend on, so that we won't break those. You can also submit tests for tutorials you use, etc. The more code is submitted, the more likely it is that we will also not break code that isn't submitted.
If you have a lot of tests, you can also apply to join our program where we run your tests in CI as a separate shard on your hardware without you having to contribute the code itself. Google has actually contributed literally tens of thousands of tests in this way -- for example, we run all of GPay's tests with every commit, and so we can't make changes that would break GPay (or, alternatively, we work with the GPay team to fix their code first; ask me about PR #89451 sigh). So far no other big company has contributed tests in this way, but we are open to it. (It does require also contributing someone to work with us on a day to day basis to keep the tests running and to track down the sources of failures, since we couldn't see the code in this scenario.)
2: We do list 9 different places, you're right. We should probably clean that up. The reality is of the nine there's really only two or three big communities; the r/FlutterDev community is listed twice (once as Reddit and once as Discord), and StackOverflow is the other big one. I've taken a note to see if we can clean that up when I get back from vacation. This is good feedback, thanks.
3: We have some curating here with the Flutter Favorites program but you're right that choosing dependencies is hard. I'm open to ideas on how to improve this. ("Google should contribute more to Flutter so that it does more out of the box" is unfortunately not an option I have available, nor is "Google should review every package uploaded to pub.dev". Fundamentally Flutter is an open source project and while Google does contribute a few dozen full-time people across various roles to the project, as well as contributing its name to lend the project credibility, there is a limit to how much Google can spend here before bean counters start asking what exactly we're getting back beyond good will, heh.)
4a: Router is actually quite useful when the problem you're trying to solve is "how do I manage my navigation stack using my app state as the source of truth" (as opposed to having to manage it using the imperative API that Navigator exposes). That said, if that's not a problem that you are facing, you should IMHO stick with Navigator.
At the end of the day, Router and Navigator are just widgets and you don't actually have to use either. (Navigator is necessary if you're going to use dialog boxes and other widgets that need a Navigator to show their pop-up UI, but that's about it.) I often will write applications that don't use Navigator or Router at all, especially in embedded scenarios.
4b: Yeah JSON and Dart really don't mesh well (frankly it's not limited to Dart, most strongly typed languages have trouble with JSON's loosy-goosy approach because the whole point of a type system is to prevent exactly the kind of code that JSON begs for). The good news here is that we're actively working on Dart language changes that should address this. Look for updates about that next year, probably after the summer (we're being SUPER CAREFUL with these changes because they have the potential to make everything worse).
4c: Yeah, the button colouring thing is a bit unfortunate. The underlying problem is that saying a button is green isn't really enough, because buttons have so many different colours (normal, disabled, hovered, pushed, focused, combinations of those). That said, there's a trick that makes it slightly cleaner, namely using
styleFrom, which is used something like this:See the API docs for more details.
Anyway, my core answer is just: file bugs, or click the "thumbs up" button on existing GitHub issues. Make sure to send feedback on the quarterly surveys. We (Google, not necessarily other Flutter contributors) actually base everything we do on feedback from the wider community.
I personally really want to make Flutter something that is fun to use, so this kind of feedback is really valuable. Please don't hesitate to reach out to me by e-mail ([email protected]) if you have ideas on how to make Flutter more fun to use.