News for hackers. Stuff that matters.
Re:Flutter for Linux by RivieraKid on Wednesday July 08, 2020 @02:20PM (#23772710)
I've been using Flutter in the last few months and agree. It's the best multi-platform solution for mobile, although it still doesn't match native behavior and performance, it only gets close.

On the web it's DOA for most use cases - it's just a canvas, so scrolling, text selection, shadow rendering, etc. is custom, doesn't feel native and must be downloaded and compiled.

It can have a future on desktop. One "cultural" obstacle is that the de facto default widget system is Material, which is simply a wrong approach to desktop UI.

Re:Flutter for Linux by akerro on Wednesday July 08, 2020 @03:20PM (#23773305)
>It's the best multi-platform solution for mobile

They announced beta version for Windows in the last few weeks, so what to expect? I've been using it on linux desktop for 4 months so far, there were many problems, but it's absolutely the best framework so far. It's miles ahead of Qt (which I've been programming in since 2010). Dart and flutter are just years ahead of Java, C#, Qt and React Native in terms of positive programmer experience, productivity, good looking UI. There are so many bad things to say too, but all I can think about are only due to immature ecosystem, but that's changing literally daily.

Re:Flutter for Linux by brnt on Wednesday July 08, 2020 @06:01PM (#23774670)
Hoe is it ahead of Qt (on desktop)?
Re:Flutter for Linux by heavyset_go on Wednesday July 08, 2020 @08:27PM (#23775778)
I'm wondering this, too. While I enjoy Flutter, it doesn't hold a candle to the extensive Qt library and QML.
Re:Flutter for Linux by pjmlp on Thursday July 09, 2020 @02:25AM (#23777503)
Specially to the graphical designer tools, or the quality of third party component libraries.
Re:Flutter for Linux by akerro on Thursday July 09, 2020 @03:40AM (#23777872)
I wrote it's more pleasant to be used by programmers by giving better experience, then I wrote it's ecosystem is immature, but growing. As of now, it has its better and worse sides.
Re:Flutter for Linux by rowanG077 on Wednesday July 08, 2020 @06:26PM (#23774884)
Dart is the reason I don't like flutter.

Why do you feel C# is worse then Dart?

Re:Flutter for Linux by satvikpendem on Wednesday July 08, 2020 @06:58PM (#23775174)
Dart is...fine. The real value comes in its code generation features, which enable packages to add whatever language features they want even if the language maintainers don't (yet), such as algebraic data types, functional programming features, etc. You can argue this as being good or bad for future maintenance but it's nice to have the ability to add to the language.
Re:Flutter for Linux by virtualwhys on Wednesday July 08, 2020 @10:00PM (#23776278)
> The real value comes in its code generation features, which enable packages to add whatever language features they want

Got any eamples of ADTs, pattern matching, immutable collections, data classes, named parameters, etc.?

Coming from Scala and TypeScript the Dart language is pretty unappealing wrt syntax and functionality, kind of archaic actually. Flutter looks amazing and have been hoping that Dart would evolve more quickly than it has.

Re:Flutter for Linux by g5becks on Wednesday July 08, 2020 @10:51PM (#23776509)
https://pub.dev/packages/freezed is ADTs, pattern matching, Dataclasses. named parameters are already part of the language.

There’s about 4 different packages that provide immutable collections, built_collections might be the most popular.

Re:Flutter for Linux by cutler on Thursday July 09, 2020 @04:00AM (#23777961)
Dart is just about tolerable but Dart + Flutter widget hell is not.
Re:Flutter for Linux by _pmf_ on Thursday July 09, 2020 @02:16AM (#23777455)
> It's miles ahead of Qt (which I've been programming in since 2010).

Would you mind elaborating?

Re:Flutter for Linux by cutler on Thursday July 09, 2020 @03:58AM (#23777950)
Flutter widget hell makes Javascript callback trees look tame. I just don't get the buzz around this atrocious style of coding.
Re:Flutter for Linux by rkangel on Thursday July 09, 2020 @05:15AM (#23778345)
You commented this elsewhere too without elaboration. I'm curious as to what you mean by 'widget hell'.

I founded the nested tree of widgets syntax good after getting over the (short) initial learning curve. Some basic good programming practice over shared bits and it was very maintainable even for complex screens.

Re:Flutter for Linux by cutler on Thursday July 09, 2020 @05:38AM (#23778467)
Why is this style of programming frowned upon in Javascript yet idiomatic in Flutter?
Re:Flutter for Linux by imtringued on Thursday July 09, 2020 @06:15AM (#23778618)
I'm not sure what you are talking about. Javascript developers also use HTML and the ability to nest HTML elements is "idiomatic" as well.
Re:Flutter for Linux by rkangel on Thursday July 09, 2020 @06:30AM (#23778692)
This is a wonderful answer and much better than what I was about to write.

Flutter Widgets, like HTML are declarative. They're just hierarchical information. This works in HTML, and it works in Flutter - there's nothing to get confused about.

Nested control flow (if statements, loops etc.) obscures the actual behaviour and so good practice is to break it up until it is clear and understandable.

Re:Flutter for Linux by BiteCode_dev on Thursday July 09, 2020 @06:07AM (#23778583)
Widgets are declarative, like in HTML, the nesting is additional information. With callback hell, you nest logic, and actually obfusc information about the control flow.
Re:Flutter for Linux by reactchain on Wednesday July 08, 2020 @10:16PM (#23776359)
Flutter for web feels like going back to the .net "webforms" days, where you could supposedly build a web app the same way as a desktop one and the whole client-server thing was abstracted away. Except it sucked, I still have nightmares about viewstate. Seeing Flutter apps that render everything to canvas feels similar.

Developing once for iOS and Android seems obvious and doable, but extending that to the web is a different game.

Re:Flutter for Linux by pjmlp on Thursday July 09, 2020 @02:26AM (#23777510)
Welcome to WebAssembly + WebGL future.
Re:Flutter for Linux by reactchain on Friday July 10, 2020 @11:18PM (#23799174)
I think the goal of running native speed compiled-ish code on the browser in a sandboxed way would be great if it worked. CSS and HTML for "apps" has always seemed like a hack to me. The problem is every single attempt to do this in the past has resulted in a bloated mess. Maybe this time will be different...
Re:Flutter for Linux by nightowl_games on Thursday July 09, 2020 @02:43AM (#23777610)
I am a believer!
Re:Flutter for Linux by pjmlp on Thursday July 09, 2020 @03:00AM (#23777682)
The irony is that with WebAssembly maturing, we will have the revenge of plugins, and stuff like Flash is already being brought back, but hey now it is a standard browser feature.
Re:Flutter for Linux by jamil7 on Thursday July 09, 2020 @04:02AM (#23777974)
> Developing once for iOS and Android seems obvious and doable

After shipping an app in it this year I've become a big fan of Kotlin Native, you can do enough code sharing to take the edge of doing two apps as a solo dev while having very little friction to access native views and APIs. The two apps feel like platform citizens on each OS but I have networking, persistence, utils and state management shared between them.

Re:Flutter for Linux by bepvte on Wednesday July 08, 2020 @05:35PM (#23774509)
Flutter only falls back on the canvas, it avoids using anything but html elements if it can. Fancy animations tend to resort to the canvas
Re:Flutter for Linux by muth02446 on Wednesday July 08, 2020 @02:55PM (#23773088)
I wish the dart/flutter team would focus on improving dart for web (e.g. by updating/fixing the JS bindings) instead of chasing flutter for web which seems like a long shot and rather hacky (referring to using the canvas for rendering content)
Re:Flutter for Linux by vesinisa on Wednesday July 08, 2020 @04:46PM (#23774054)
> using the canvas for rendering content

This sounds like Flash all over again. Let me guess - no native text select, copy & paste supported? Scrolling is "wrong" in a subtle way?

Re:Flutter for Linux by timsneath on Wednesday July 08, 2020 @05:36PM (#23774515)
We haven't reached perfection yet (that's why we're still in beta), but our goal is to be _very_ different to Flash in these kinds of areas.

Here's an example of text fields: https://gallery.flutter.dev/#/demo/text-field

Right-click and you have access to the browser context menu; choose Inspect and you can see a <textarea> or <input> control.

Re:Flutter for Linux by vesinisa on Wednesday July 08, 2020 @09:14PM (#23776054)
Frankly that feels exactly like a Flash page. Natively selecting text content isn't supported on either Firefox or Chrome on Android (apart from within inputs). Scrolling is broken ("yanky").

Flutter for Web further feels like a nightmare for accessibility. I tried enabling the native Google screenreader on my device. It only says "No text found at that location" when I try to read any of the Flutter demo pages in either Chrome or Firefox. In addition to being extremely hostile to people with disabilities, it will soon actually be illegal to build new products with accessibility-hostile tech like Flutter for Web for large parts of the European public and private sector:

https://en.wikipedia.org/wiki/European_Accessibility_Act

> we're still in beta

From these viewpoints that feels more like an early alpha product. In 2020 no accessibility support is a non-starter.

Re:Flutter for Linux by mwcampbell on Wednesday July 08, 2020 @10:29PM (#23776412)
About accessibility, you need to find the "Enable accessibility" button and press it first. It's not visible on screen, but you should be able to find it with your screen reader's navigation commands (e.g. swiping left and right on a touch device). Yeah, it kind of sucks that the user has to turn accessibility on, and for that reason alone, I will never willingly develop a web application with Flutter. But at least it does support accessibility.
Re:Flutter for Linux by vesinisa on Thursday July 09, 2020 @03:48AM (#23777907)
Right, to be fair I was able to enable the accessibility mode with your instructions. This way, the text content is indeed accessible to a screen reader. However, navigation in any of the demo apps with a screen reader was completely broken. So a user might be able to read a single page but not discover further content. With normal web pages we usually have <a> elements that enable navigation regardless of visual gimmicks.
Re:Flutter for Linux by dmitriid on Thursday July 09, 2020 @04:15AM (#23778040)
Don't kid yourselves. Web target is very much early alpha for Dart.

There are so many obvious problems with it:

- Everything relies on 1500 nested custom elements with hardcoded transforms to put them in place

- This breaks default browser interaction with the page entirely. Because what may look like a page is actually a bunch of absolutely positioned controls with absolutely positioned canvas inside them.

- Scrolling, one of the most important things in a browser, is broken. It's janky and slow (manually re-implemented?). I'm guessing containers have to be explicitly marked as scrollable with correct sizes, because resizing the browser window does not make content scrollable (try it with the demo you linked).

- Text is broken. Because it's rendered onto a canvas. So, all text interactions + accessibility is broken. Fonts are rendered incorrectly. I mean, on the demo page you can't even copy code other than through the "Copy All" button.

- Navigation is broken. Navigating the demo apps (which have more than one page) is not reflected in the url, so the back/forward buttons are broken

- Keyboard navigation is broken. Nearly none of the elements can be tabbed to. Except some buttons in demo pages. I guess they are explicitly marked as such?

- When elements can be navigated to by keyboard, they can only be activated by Spacebar. Even though Enter also exists. I'm pretty sure forms cannot be submitted by pressing enter, either.

- iOS-style date pickers are clipped in Safari

- 2D transformations demo is broken in Safari

It's just me spending five minutes on the demo site.

The effort is certainly commendable. It's not beta yet. It's possible you may want to scrap this and go the Figma route. They implemented their own rendering engine in WebGL: https://www.figma.com/blog/building-a-professional-design-to...

-

Re:Flutter for Linux by tomc1985 on Thursday July 09, 2020 @02:23AM (#23777492)
That demo runs horribly on Firefox.

And clicking around seems to completely ignore my back button.

And hotspots didnt change to the finger cursor.

It looked pretty slick, except for those points. Oh well...

Re:Flutter for Linux by johnday on Friday July 10, 2020 @08:35AM (#23790851)
It's also super laggy for me on Chrome.
Re:Flutter for Linux by metta2uall on Wednesday July 08, 2020 @09:55PM (#23776241)
That's really cool but I think all text, such as "Please enter only alphabetical characters", should be selectable. For example someone may want to copy & paste it into a bug report.
Re:Flutter for Linux by nl on Thursday July 09, 2020 @12:02AM (#23776832)
https://gallery.flutter.dev/#/fortnightly

Basic features like selecting the text doesn't work.

Re:Flutter for Linux by _pmf_ on Thursday July 09, 2020 @02:14AM (#23777444)
"Flutter allows content providers to protect their IP by not allowing text theft out of the box"
Re:Flutter for Linux by sciurus on Wednesday July 08, 2020 @07:43PM (#23775501)
I loaded that page in both Chrome and Firefox Preview on a Pixel 3a and switching between text inputs or scrolling feels quite janky
Re:Flutter for Linux by lenkite on Thursday July 09, 2020 @01:35AM (#23777219)
The gallery apps don't even support the browser back button after going into a detail page. I guess this is still alpha stuff presently.
Re:Flutter for Linux by yesimahuman on Wednesday July 08, 2020 @08:50PM (#23775921)
Yea, Flutter Web isn’t viable and likely never will be. The approach will require re-implementing browser primitives (like copy paste) which means you’re always going to need to ship a ton of JS to clients which makes it antithetical to the PWA approach.

EDIT: thanks for the downvote. But you don’t have to take my word for it, this sentiment is (privately) shared by Googlers themselves working on Chrome and PWAs.

Re:Flutter for Linux by yxhuvud on Thursday July 09, 2020 @02:18AM (#23777462)
Om The flip side, modern javascript frameworks seems to like to reinvent the basic primitives as well (based on how often my back button is broken), so I'm not certain that will be a deal-breaker.
Re:Flutter for Linux by spiderfarmer on Wednesday July 08, 2020 @04:55PM (#23774133)
Tie it in with AMP and you have the webdev cocktail from hell.
Re:Flutter for Linux by axegon_ on Wednesday July 08, 2020 @07:34PM (#23775444)
+1 on this one. I've fiddled with angular dart for instance and tbh as someone who is horrible with doing frontend and hates js with a passion, this was enjoyable. Yet the release of the newer version[0] is taking forever.

[0] https://github.com/dart-lang/angular/pull/1892