Colbertchen
Colbertchen

Reputation: 11

In flutter, Is it possible to use Android or iOS widget, just like react native

As we know, flutter can call Android or iOS api by plugin, I had written some widgets, Android and iOS native widgets, can I use those widgets in flutter, just like in react native. Thanks.

Upvotes: 1

Views: 2077

Answers (3)

Miguel Beltran
Miguel Beltran

Reputation: 2202

Yes, you can.

With https://api.flutter.dev/flutter/widgets/AndroidView-class.html (Android) and https://api.flutter.dev/flutter/widgets/UiKitView-class.html (iOS)

Google is using this two Widgets to render WebViews and Maps on those platforms. See: https://pub.dev/packages/webview_flutter and https://pub.dev/packages/google_maps_flutter

It is definitely not easy to use, but it is possible.

Upvotes: 1

Dean Chalk
Dean Chalk

Reputation: 20461

The simple answer is NO

Flutter completely bypasses the iOS and Android OEM control pipeline and draws the entire screen as a Skia canvas, with its own dart UI widgets.

There is no mechanism to mix the flutter canvas with OEM controls

Upvotes: 0

Hemanth Raj
Hemanth Raj

Reputation: 34769

If you are looking for App Widgets that are shown on android desktop, then it is possible to implement such Widgets with native code and use it with flutter.

I'll not completely deny that it is not possible to bridge between native widget and flutter's dart code, but I can say the possibility is yet to be discovered.

Here is the simple App Widget created natively and used with flutter.

Gif image

If you wanted to look into the source code, and build app from source. Here it is.

Hope that helped!

Upvotes: 0

Related Questions