Hacker News new | ask | show | jobs
by skhro87 3033 days ago
I recently rewrote a small app in flutter that was originally react native. Initially I was sceptical, mainly about learning dart. But it wasn't hard to pick up.

I found the development experience much smoother than react native, things just worked, whereas in react native there were many many small bugs and issues with the many packages required.

Flutter IDE support is good with the intellij plugin [1]. Performance, I didn't do any benchmarks, but a simple list with thousands of items feels much smoother on flutter than react native. There are packages for redux as well in flutter, so state management is taken care of [2]. The only downside I experienced with flutter is that Json handling is clumsy, apparently because flutter doesn't support reflection, which would be necessary to have comfortable Json-decoding like with Javas gson or go's json package [3].

Another thing to consider is that react native will render on one thread, and handle the application logic on another thread, but that means the application logic is still restricted to a single javascript thread, which can lead to bottlenecks eventually. From what I understand (haven't tested), dart can work multithreaded, having an advantages there.

End of the day, I would chose flutter over react native. Mainly because of Javascript and all the pain that comes with it.

[1] https://plugins.jetbrains.com/plugin/9212-flutter

[2] https://pub.dartlang.org/packages/flutter_redux

[3] https://github.com/flutter/flutter/issues/1150

2 comments

This is exactly one of the things I was curious to know about Flutter vs alternatives. Having already been burned by Dart 1 and its promise of web components, I'm more cautious for a cure-all.

If the development workflow is good, trying it on a smaller Android project seems feasible. What I find attractive there is that you can sidestep the legacy Android APIs which was created for much more constrained hardware than we run today. Might even be worth just doing that and keeping iOS development the same. If iOS 12 widgets all look different, that would age Flutter apps.

How is the integration of Flutter apps with the rest of the Android system/apps? Given that Flutter does not use the platform native widgets -- do Flutter apps look or behave different?

How difficult it is to use a Java library from Dart?

Disclaimer: I work on the Dart VM and Flutter engine

The Flutter team has done an amazing job recreating Material and Cupertino (iOS) widgets, and I honestly can't tell the difference. Also, platform specific behaviors (e.g., the scroll bounce on iOS) are also preserved.

If you haven't seen a Flutter app in the wild, I'd highly recommend checking out the Gallery application on Google Play (https://play.google.com/store/apps/details?id=io.flutter.gal...). Here you can see all the available widgets for each platform and even toggle between iOS and Android behaviors.

Given flutter can call down to iOS with plugins, and given that the apps are native, apparently, is it not possible to natively use the actual iOS widgets instead of reimplementing them?
For widgets it's not just calling to iOS that matters, but being able to render the widgets as part of the painting process, which Fluter does as a completely separate process from how iOS renders. So to integrate it, you'd need something involving compositing native views properly and yet propagating touch events to them, or rendering native views on top but doing the right masking, or ...