Reputation: 11
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
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
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
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.
If you wanted to look into the source code, and build app from source. Here it is.
Hope that helped!
Upvotes: 0