Live data from Hacker News

Exploring Flutter for Cross-Platform Mobile Development

sethlopez.me

61–70 of 92 posts

Re: Exploring Flutter for Cross-Platform Mobile Development

#61

Earlier quoted context omitted.

I'm developing a game with React Native [1], and I have a single codebase that works on iOS, Android, Windows, and web (via react-native-web, although it needs a lot of work.) I've had to write a few 'native modules' for various platforms, but it has to be platform-specific code anyway (e.g. ad networks, in-app purchases, game services) I've been looking for a way to write some native code that I can compile to JS, a…

Rust should be just as easy to compile for those platforms. Using something you're comfortable with is good though!

Yeah, that recent post [1] gave me a bit more confidence. Ooh, and it looks like I can compile Rust to wasm with emscripten! [2] I might have to reconsider Rust.

[1] https://michaelfairley.com/blog/i-made-a-game-in-rust/

[2] https://users.rust-lang.org/t/compiling-to-the-web-with-rust...

Re: Exploring Flutter for Cross-Platform Mobile Development

#62
From a quick look at the sample code and a scrub through the video, it sounds a lot like JavaFX, especially when combined with the Kotlin TornadoFX extensions.

Relatively recent build of a custom widget toolkit? Check.

GPU accelerated 60fps compositing, render and animation layer? Check.

IntelliJ as the IDE? Certainly. Although JFX is perfectly usable from any Java IDE?

Cross platform including across iOS and Android? Check. (except JFX also does Mac/Win/Linux).

Fairly standard layout and box packing model. Check.

Material design? Via a third party company called Gluon, check.

Functional reactive design? Check.

Async/await? Yes, Kotlin has coroutines that integrate with JavaFX.

Hot reload? Actually yes, JVM+TornadoFX has some support for this, although it's not as slick as what Flutter can do ... the view you're working on will be sometimes be thrown out and rebuilt. But if you change your CSS or the behaviour of e.g. event handlers, then you can do hot reload.

There are some differences I see. Dart focuses more on AOT compilation. Another is immutable widgets in Flutter. That one I'm not convinced about at all.

> You can respond to events, like user interaction, by telling the framework to replace a widget in the hierarchy with another widget. The framework then compares the new and old widgets and efficiently updates the user interface.

No explanation for this odd design is provided. I suppose they believe it is self-evidently superior, but that seems like a lot of overhead for very little to me. After all, GUI is pretty much THE standard definition of a big pile of mutable state, and trying to pretend its not by just generating more garbage than a normal GCd toolkit would seems a little strange.

Re: Exploring Flutter for Cross-Platform Mobile Development

#63
post #57

Earlier quoted context omitted.

Perhaps because Qt occupies a couple of niches that don't have a particularly entrenched native look and feel or are not very widely used. Home entertainment systems, in-vehicle entertainment systems, kiosks, medical devices, avionics, Linux desktop apps, printer displays, navigation systems, industrial equipment controls, these are the sort of things that Qt is mostly used for. Do you use a Qt desktop or mobile app…

Don't you use vlc?

No I don't.

Re: Exploring Flutter for Cross-Platform Mobile Development

#64

From a quick look at the sample code and a scrub through the video, it sounds a lot like JavaFX, especially when combined with the Kotlin TornadoFX extensions. Relatively recent build of a custom widget toolkit? Check. GPU accelerated 60fps compositing, render and animation layer? Check. IntelliJ as the IDE? Certainly. Although JFX is perfectly usable from any Java IDE? Cross platform including across iOS and Android…

>> You can respond to events, like user interaction, by telling the framework to replace a widget in the hierarchy with another widget. The framework then compares the new and old widgets and efficiently updates the user interface.

>No explanation for this odd design is provided.

I suspect that's to support how they provided both an iOS and Material design look and feel. For example, there isn't a single button widget with different styling. There's a CupertinoButton and a RaisedButton.

Re: Exploring Flutter for Cross-Platform Mobile Development

#65

This may be off-topic but I'm wondering if there is any chance to see cross platform and cross language toolkits any time soon. Something based on WebAssembly so that we don't have to worry or bash about programming languages. Dart is cool but should we all learn Dart now?

I don't know how good it is, but there is a company called RemObjects Elements http://www.elementscompiler.com/elements/ which cross compile Windows (.NET), Android (Java), iOS (Object C / Swift), Linux/Android (C++).

Re: Exploring Flutter for Cross-Platform Mobile Development

#66

Earlier quoted context omitted.

Not only that but if you reimplement the widgets then your always playing catch up when they change. It's better to just use the platform's 'primitive views' then constantly reinventing a wheel that looks similar. Someone else also mentioned accessibility which to me is a deal breaker if your app doesn't match a native apps accessibility.

Is there any such toolkit? What exactly is "platform's 'primitive views'"? Usually the "native" implementations are actually bindings to the native APIs which require heroic courage(a lot of manual tweaking), not to mention that you still need to catch up/update your bindings when these APIs change.

WxWidgets are kind of that in C++ land at least. I know they use GTK on Linux and native widgets on Windows. They might not have good OSX support though.

Re: Exploring Flutter for Cross-Platform Mobile Development

#67

Earlier quoted context omitted.

Perhaps because Qt occupies a couple of niches that don't have a particularly entrenched native look and feel or are not very widely used. Home entertainment systems, in-vehicle entertainment systems, kiosks, medical devices, avionics, Linux desktop apps, printer displays, navigation systems, industrial equipment controls, these are the sort of things that Qt is mostly used for. Do you use a Qt desktop or mobile app…

Microsoft also did that in WPF. For Windows PCs, it was already a widely used native look and feel. Also wide selection of native Win32 controls, mostly implemented in ComCtl32.dll. Yet in WPF I can easily replicate native look and feels, if I want so.

That's because WPF like winforms used native windows controls under the hood. Calls would be marshaled via pinvoke.

Re: Exploring Flutter for Cross-Platform Mobile Development

#68
post #40
post #39

Earlier quoted context omitted.

> Personally, I think it makes sense to differentiate between something which takes one child and something which takes an array of children. Could you please explain this - it doesn't make sense to me. To me it seems clearly and unambiguously true that a single child is not a special case vs multiple children, but rather just a list of children that is 1 long. I can't think of any cases where handling both as an arr…

Take the Container class in Flutter, it can only take a single Widget as a child. Having to write a list of children that is 1 long every time I use a container doesn't make sense to me, and to me seems confusing as it will lead to people trying to add more items. I don't know, that's my opinion, maybe I'm wrong :)

Sounds like they took that from Android where IIRC a scrollview could only take one child. Coming from Win32 Android, back in the G1 days, always had its own idiosyncrasies.

Re: Exploring Flutter for Cross-Platform Mobile Development

#69
This feels like a bad idea. Let's write a platform on Dart which is esoteric in terms of usage and community and hope for the best? Seriously? The whole reason to do a framework is to make it big so it has a tons of community support. I just don't understand the point although it looks elegant.

Re: Exploring Flutter for Cross-Platform Mobile Development

#70

From a quick look at the sample code and a scrub through the video, it sounds a lot like JavaFX, especially when combined with the Kotlin TornadoFX extensions. Relatively recent build of a custom widget toolkit? Check. GPU accelerated 60fps compositing, render and animation layer? Check. IntelliJ as the IDE? Certainly. Although JFX is perfectly usable from any Java IDE? Cross platform including across iOS and Android…

Flutter has stateful widgets too, and they can be arbitrarily nested with stateless widgets.

Stateless widgets are useful for static boilerplate that only changes when moving to a different screen, or when swapping out an entire subview. Supporting arbitrary mutations is extra coding that's unnecessary when it's not going to change anyway. Why implement it when you don't have to?

Note that even with entirely stateful widgets, if the whole layout changes, the whole subtree generally to be thrown out which also creates garbage.

Post reply on HN