text stringlengths 1 372 |
|---|
use the following instructions: |
<topic_end> |
<topic_start> |
open-source third-party library |
to create a flutter plugin that includes both |
C/C++/Objective-C and dart code, |
use the following instructions: |
the native code is then statically linked into |
the application binary of any app that uses |
this plugin. |
<topic_end> |
<topic_start> |
closed-source third-party library |
to create a flutter plugin that includes dart |
source code, but distribute the C/C++ library |
in binary form, use the following instructions: |
warning warning |
do not upload this plugin |
(or any plugin containing binary code) to pub.dev. |
instead, this plugin should be downloaded |
from a trusted third-party, |
as shown in the CocoaPods example. |
<topic_end> |
<topic_start> |
stripping iOS symbols |
when creating a release archive (ipa), |
the symbols are stripped by xcode. |
<topic_end> |
<topic_start> |
other resources |
to learn more about c interoperability, check out these videos: |
<topic_end> |
<topic_start> |
hosting native iOS views in your flutter app with platform views |
platform views allow you to embed native views in a flutter app, |
so you can apply transforms, clips, and opacity to the native view |
from dart. |
this allows you, for example, to use the native |
google maps from the android and iOS SDKs |
directly inside your flutter app. |
info note |
this page discusses how to host your own native iOS views |
within a flutter app. |
if you’d like to embed native android views |
in your flutter app, |
see hosting native android views. |
iOS only uses hybrid composition, |
which means that the native |
UIView is appended to the view hierarchy. |
to create a platform view on iOS, |
use the following instructions: |
<topic_end> |
<topic_start> |
on the dart side |
on the dart side, create a widget |
and add the build implementation, |
as shown in the following steps. |
in the dart widget file, make changes similar to those |
shown in native_view_example.dart: |
add the following imports: |
<code_start> |
import 'package:flutter/foundation.dart'; |
import 'package:flutter/services.dart'; |
<code_end> |
implement a build() method: |
<code_start> |
widget build(BuildContext context) { |
// this is used in the platform side to register the view. |
const string viewType = '<platform-view-type>'; |
// pass parameters to the platform side. |
final Map<String, dynamic> creationParams = <string, dynamic>{}; |
return UiKitView( |
viewType: viewType, |
layoutDirection: TextDirection.ltr, |
creationParams: creationParams, |
creationParamsCodec: const StandardMessageCodec(), |
); |
} |
<code_end> |
for more information, see the API docs for: |
UIKitView. |
<topic_end> |
<topic_start> |
on the platform side |
on the platform side, use either swift or Objective-C: |
implement the factory and the platform view. |
the FLNativeViewFactory creates the platform view, |
and the platform view provides a reference to the UIView. |
for example, FLNativeView.swift: |
finally, register the platform view. |
this can be done in an app or a plugin. |
for app registration, |
modify the app’s AppDelegate.swift: |
for plugin registration, |
modify the plugin’s main file |
(for example, FLPlugin.swift): |
in Objective-C, add the headers for the factory and the platform view. |
for example, as shown in FLNativeView.h: |
implement the factory and the platform view. |
the FLNativeViewFactory creates the platform view, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.