Hacker News new | ask | show | jobs
by chooseaname 2338 days ago
> I guess that's what Flutter is doing (for both iOS and Android).

How does it do this as opposed to adding yet one more layer? Does it somehow get beneath all the cruft mentioned?

5 comments

It is another layer, but it has as small as possible dependence on the below layers (UIKit, OpenGLES, posix) and instead tries to reimplement everything. For instance, if you want a slider control, that’s not going to use UISlider underneath, it’s going to reimplement it from scratch.

The problem with this is that it is an enormous task and they have barely scratched the surface of it.

Flutter is hardly the first reimplement the world GUI programming environment that tries to match the existing first party environment in terms of look and feel. Java swing was pretty much the same idea 20 years ago, and probably had more investment and momentum behind it than Flutter does today. While I can think of a number of swing success stories, I don’t think java swing as a whole was successful in what it set out to do.

> The problem with this is that it is an enormous task

It's an enormous task that never ends, too. Flutter has to continually keep up with UI/UX changes that Apple makes. Without enough momentum there, the devs using their platform are going to have apps that appear/feel old, which tends to be a marketing negative for Apple users.

Flutter took the approach of treating the screen as a blank canvas. Everything is drawn using Skia primitives, exposed as Dart libraries.

It has some downsides – they had to expose a lot of accessibility features on top of that using platform APIs – but it's quite nice when you are a developer, as you can Cmd-click on anything to learn how it is drawn, and use the same tools to build your own widgets if you need.

Afaik Flutter is basically a Game Engine. Its not using the build in UI Toolkit instead rendering everything itself and just mimics the look of the native UI.

I'm not completely sure about it, i just now it from listening to some talks.

Yes. It's not using any native UI widgets or UI code, but drawing everything itself using the lowest level API it can get, which I guess on iOS is Metal (and something for input). This means that the look and feel and the behavior and accessibility features will not match those of other apps (which do use the native toolkits), or the Flutter team will have to do a lot of reverse engineering and re-implementation to match that on each platform.
Currently, Flutter targets OpenGL ES on iOS which is less than ideal.

https://github.com/flutter/flutter/issues/18208

"We were discussing this in today's Triage meeting. Our current plan is to turn Metal on soon. This will increase the size of our engine by ~200KB. We can eventually reduce this by removing the OpenGL code but (a) that would drop support for <iOS10, which we don't want to do anytime soon (Skia only does Metal from iOS10), and (b) would require some work from the Skia team (OpenGL can't currently be removed from the codebase)."

Seems like it will be solved 'soon'

I am really curious why you are concerned at all about supporting iOS 9 (and lower?) at this point. That's a tiny, tiny fraction of worldwide iOS users. Probably not more than 1%. How many people are creating apps in Flutter that need to target that far back, and that user base?
Besides being a cross platform platform for Android and iOS, it appears to be a native UI framework for Fuchsia, Google’s nearly ‘from scratch’ OS.