Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can't Flutter do that native Android or iOS SDK can?

Recently I came across this new fancy, as they call it "SDK for crafting high-quality native interfaces", thing called Flutter.

However, there are a few things that are still unclear to me. Are there any things that can not be achieved using Flutter that could be easily done via native Android or IOS SDKs?

They say that if we need native functionality we can easily code it using MethodChannel on Android and FlutterMethodChannel on IOS.

As far as it seems, Flutter is promising in fast and quite easy app prototyping, however, would you consider using it for applications that might require a lot of native SDK functionality such as background services, sensor data, etc...

like image 775
Mantelijo Avatar asked Dec 17 '22 23:12

Mantelijo


1 Answers

The way I think of flutter as a framework is it has two main parts. First, it wraps a rendering engine with high level primitives for implementing modern mobile apps. This part includes things like gesture detection, animation, physics, and everything else in these slides. This is the core of what Flutter has to offer.

Second, Flutter is a series of native platform plugins. Plugins delegate work to the platform, which in turn implement platform-specific capabilities and report back to flutter through a unified, platform-independent, interface. This includes things like GPS, camera, media playback, etc. Plugins leverage the underlying platform to enhance core functionality with things Flutter can't or doesn't want to reimplement by itself.

In this sense, Flutter is potentially no less capable than the platform it runs on, provided there are plugins that will surface the needed functionality. We are not there yet but there's already a lot you can do with the existing plugins, plus the ecosystem is growing. For example, just last week community added support for video recording in the official camera package.

That said, there are cases when the advantages of Flutter start to diminish. One such example I can think of is that Flutter's rendering engine, Skia, is a 2D rendering engine, so if you're trying to do things like 3D graphics you might find yourself working around the framework by writing more plugins than actual Flutter. 2D rendering is what you'll want for most apps, but it makes the framework less appropriate in special use cases like gaming.

Besides, you'll definitely see limitations due to Flutter and Dart being in its early years. E.g. Flutter only outputs Android APKs for arm targets at the moment. But there is no inherent reason why this happens, problems like this will likely be resolved given time.

like image 131
Edman Avatar answered Jan 05 '23 10:01

Edman