TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Initial experience creating cross-platform apps with Flutter and Dart

90 pointsby charris0over 7 years ago

12 comments

roughikeover 7 years ago
As a native mobile developer of several years, I&#x27;ve always been somewhat skeptical of the various cross-platform solutions that have emerged over the years.<p>The WebView-based solutions weren&#x27;t fast enough and sometimes behaved differently across devices because of different WebView versions. With React Native, the impression was far better because the performance actually can be quite good. But it&#x27;s still hard to abstract the UI layer away when even the native Views on Android behave differently across devices and Android versions. I had to use almost a half of a day for fixing invisible drop-down menu items on some specific Samsung device on Android 4.1.2. Not to mention when you have to abstract the UI for both Android &amp; iOS, which brings its own set of problems. It&#x27;s one of the reasons why such a fundamental thing as navigation has been so hard to get right.<p>I feel Flutter is the first cross-platform SDK that gets something fundamentally right. Since every pixel on the UI is rendered by the framework, we as developers have better control of everything. It&#x27;s going to have much better performance because there are no bridges between native and cross-platform land. Additionally, Samsung can&#x27;t fuck up our UIs: once the UI works, it works the same on every device.<p>As a bonus, they also keep tremendous care of their codebase and they have the best documentation I&#x27;ve ever seen. My really simple, quick 4-line fix didn&#x27;t go through until I wrote 30 lines of automated tests to go with it. After all, Flutter is going to be the native SDK for developing apps for Fuchsia, and I think Google has learned not to repeat the same mistakes that happened with Android again.
评论 #15418606 未加载
评论 #15418074 未加载
评论 #15418351 未加载
yawnover 7 years ago
&gt; So Flutter is actually pushing pixels itself, sounds strange, but it works<p>The siren song of cross-platform development sounds so sweet to the ears and I&#x27;ve fallen for it quite a few times only to get bitten in the end. Introducing another layer between you and the source has several drawbacks: it&#x27;s an additional source for bugs, it makes you reliant on the middle man to be timely with updates to keep pace of the native changes and bug fixes, it can prevent you from using time-saving tooling for the native environment, etc.<p>What happens when the native controls change? What do I see when I&#x27;m running an older native version?
评论 #15417691 未加载
评论 #15417967 未加载
评论 #15417395 未加载
评论 #15417861 未加载
评论 #15417643 未加载
评论 #15431392 未加载
htormeyover 7 years ago
I think the article would have been much better if the author had left out the section about RN. Failing that I would have liked to see him dig into why RN was slow for his use case and what he tried to do to fix theses issues.<p>&quot;While it uses the same React paradigm, there’s still a lot of differences.It seems performance is reduced significantly as your application and the react framework is controlling all the high level rendering functions from within a JavaScript control thread.&quot;<p>It really seems like this person didn&#x27;t spend a lot of time looking into performance when assessing React Native. Facebook have some really nice docs on this:<p><a href="https:&#x2F;&#x2F;facebook.github.io&#x2F;react-native&#x2F;docs&#x2F;performance.html" rel="nofollow">https:&#x2F;&#x2F;facebook.github.io&#x2F;react-native&#x2F;docs&#x2F;performance.htm...</a><p>They have a whole section on how to handle performance for user interactions&#x2F;animations&#x2F;etc which is well worth reading. Many RN related performance issues boil down to not being mindful of how javascript interacts with the native bridge. Tal Kol from Wix wrote a really great article about this, which you can find here:<p><a href="https:&#x2F;&#x2F;hackernoon.com&#x2F;moving-beyond-animations-to-user-interactions-at-60-fps-in-react-native-b6b1fa0ba525" rel="nofollow">https:&#x2F;&#x2F;hackernoon.com&#x2F;moving-beyond-animations-to-user-inte...</a><p>I&#x27;m sure Flutter&#x2F;Dart are great tools. It&#x27;s just a little odd to see someone who know&#x27;s React dismiss RN off handedly for performance reasons without making much of an effort to read the developer docs.
评论 #15418741 未加载
programmarchyover 7 years ago
Side story...<p>I wish you guys hadn&#x27;t killed Apportable. It was such an awesome product! From what I could gather, Google acquihired the Apportable team, which then pivoted to Flutter.<p>For anyone that doesn&#x27;t know, Apportable was an Obj-C to native Android compiler. It bypassed the JVM, compiling directly to the native architecture, and actually ran faster than comparable Java apps. As a compromise, it also had a Java bridging interface to hook into Android APIs. It was mainly targeted at games which used Cocos2D, but a UIKit bridge was in the works...<p>When I first heard about Apportable, I was incredibly wary of their claim, but it worked like absolute magic. I was able to successfully port several Cocos2D apps directly to Android with almost no intervention.<p>Anyway, assuming the core team is still intact, if there is anyone that can pull off what Flutter is claiming to do, it&#x27;s these folks.
MarkMcover 7 years ago
If you have an Android phone, a good demonstration of flutter is the gallery app: <a href="https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=io.flutter.gallery" rel="nofollow">https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=io.flutter.gal...</a><p>There doesn&#x27;t seem to be an equivalent iOS app, which is kind of strange for a product whose whole purpose is cross platform development. But maybe it&#x27;s not allowed on the App Store because it&#x27;s alpha or just a demo.
bsaulover 7 years ago
I&#x27;m amazed at the number of original projects i see done with Dart. Yet it always seems to be ambitious prototypes as if the language was still looking for its &quot;ruby on rail&quot; moment.<p>Not that there would be anything wrong with that, but when you combine this impression with reading titles like &quot;google coding its next OS with dart&quot;, you wonder if this language is google&#x27;s secret weapon, or if all of it is just a marketing attempt.
Zigurdover 7 years ago
Life is hard for cross-platform environments. Cross-platform apps, never mind runtimes and sdks, don&#x27;t have wide use. React Native is the only notable exception. While tools like Xamarin can make a living, that&#x27;s mostly outside of mass market apps.<p>Web apps on JS are the most compelling example of an app ecosystem that has come unmoored from underlying OSs, but iOS and Android have brought back the dominance of native apps, because the underlying platforms and their capabilities are interesting and useful.<p>Maybe Flutter is a good UI stack for Fuchsia, and maybe easy Web app compatibility would be a boost to both Flutter and Fuchsia, but it will be tough sledding to get Flutter apps accepted by Android and iOS users. Flutter needs to find a place where it is essential, not a compromise for developers searching for a panacea.<p>The reason Java is the most widely used language is that Android turned Java into a platform-specific, UI-stack-specific app language.<p>The irony is that, because of the mountain of highly capable modern mobile apps, I&#x27;d bet that the Android runtime on ChromeOS quickly becomes the most widely used cross-platform runtime, in terms of the number of apps actually used by people and running on multiple platforms.
mamcxover 7 years ago
The thing I want for this kind of tools is to be a TRUE REPLACEMENTE of webviews.<p>I don&#x27;t wanna code in JS. No in Dart, but I can accept to use it ONLY for UI rendering. SO I can use F# or Swift or any other language.<p>ie: I wanna to have a webview-html-css-alike &quot;render screen&quot; and let me use my own language in the back.
chickenbaneover 7 years ago
Coincidentally I just saw this video by Eric Seidel (the lead of the Flutter team) talking about the stack of Flutter:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=VUiVkDpikDI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=VUiVkDpikDI</a>
oweilerover 7 years ago
Flutter itself seems nice but I can&#x27;t stand Dart. It&#x27;s an okay language but isn&#x27;t expressive enough for a modern language.
评论 #15448209 未加载
brett40324over 7 years ago
Some implementation features related to a few points in comments here so far, from Flutter faq here: <a href="https:&#x2F;&#x2F;flutter.io&#x2F;faq&#x2F;" rel="nofollow">https:&#x2F;&#x2F;flutter.io&#x2F;faq&#x2F;</a><p>How does Flutter run my code on Android?<p>The engine’s C&#x2F;C++ code is compiled with Android’s NDK, and the majority of the framework and application code is running as native code compiled by the Dart compiler.<p>How does Flutter run my code on iOS?<p>The engine’s C&#x2F;C++ code is compiled with LLVM, and any Dart code is AOT-compiled into native code. The app runs using the native instruction set (no interpreter is involved).<p>Does Flutter use my system’s OEM widgets?<p>No. Instead, Flutter provides a set of widgets (including Material Design and Cupertino (iOS-styled) widgets), managed and rendered by Flutter’s framework and engine. You can browse a catalog of Flutter’s widgets.<p>We are hoping the end-result will be higher quality apps. If we reused the OEM widgets, the quality and performance of Flutter apps would be limited by the quality of those widgets.<p>In Android, for example, there’s a hard-coded set of gestures and fixed rules for disambiguating them. In Flutter, you can write your own gesture recognizer that is a first-class participant in the gesture system. Moreover, two widgets authored by different people can coordinate to disambiguate gestures.<p>Modern app design trends point towards designers and users wanting more motion-rich UIs and brand-first designs. In order to achieve that level of customized, beautiful design, Flutter is architectured to drive pixels instead of the OEM widgets.<p>By using the same renderer, framework, and set of widgets, we make it easier to publish for both iOS and Android concurrently, without having to do careful and costly planning to align two separate codebases and feature sets.<p>By using a single language, a single framework, and a single set of libraries for all of your UI (regardless if your UI is different for each mobile platform or largely consistent), we also aim to help lower app development and maintenance costs.<p>What happens when my mobile OS updates and introduces new widgets?<p>The Flutter team watches the adoption and demand for new mobile widgets from iOS and Android, and aims to work with the community to build support for new widgets. This work may come in the form of lower-level framework features, new composable widgets, or new widget implementations.<p>Flutter’s layered architecture is designed to support numerous widget libraries, and we encourage and support the community in building and maintaining widget libraries.<p>What happens when my mobile OS updates and introduces new platform capabilities?<p>Flutter’s interop and plugin system is designed to allow developers to access new mobile OS features and capabilities immediately. Developers don’t have to wait for the Flutter team to expose the new mobile OS capability.
评论 #15417829 未加载
bitwizeover 7 years ago
No.<p>You use native UI widgets or you gtfo. This may seem strange to us Linux folks, who are used to making do with any old UI. But Apple users are UI supertasters. If anything is a tiny bit off -- a bounding box one pixel too short, a response to button click one millisecond too laggy -- Apple users will notice, and Apple users will complain, and it will be reflected in your app&#x27;s sales&#x2F;metrics.<p>At least on iOS, it&#x27;s worth it to use the native widgets.
评论 #15418518 未加载
评论 #15418386 未加载