text stringlengths 1 372 |
|---|
some specific steps are needed to ensure a smooth experience. |
<topic_end> |
<topic_start> |
step 2a: define the package API (.dart) |
the API of the plugin package is defined in dart code. |
open the main hello/ folder in your favorite flutter editor. |
locate the file lib/hello.dart. |
<topic_end> |
<topic_start> |
step 2b: add android platform code (.kt/.java) |
we recommend you edit the android code using android studio. |
then use the following steps: |
the android platform code of your plugin is located in |
hello/java/com.example.hello/HelloPlugin. |
you can run the example app from android studio by |
pressing the run (▶) button. |
<topic_end> |
<topic_start> |
step 2c: add iOS platform code (.swift/.h+.m) |
we recommend you edit the iOS code using xcode. |
before editing the iOS platform code in xcode, |
first make sure that the code has been built at least once |
(in other words, run the example app from your IDE/editor, |
or in a terminal execute |
cd hello/example; flutter build ios --no-codesign). |
then use the following steps: |
the iOS platform code for your plugin is located in |
Pods/Development Pods/hello/../../example/ios/.symlinks/plugins/hello/ios/Classes |
in the project navigator. (if you are using sharedDarwinSource, |
the path will end with hello/darwin/Classes instead.) |
you can run the example app by pressing the run (▶) button. |
<topic_end> |
<topic_start> |
add CocoaPod dependencies |
use the following instructions to add HelloPod with the version 0.0.1: |
specify dependency at the end of ios/hello.podspec: |
for private pods, refer to private CocoaPods to ensure repo access: |
installing the plugin |
the pod should appear in the installation summary. |
<topic_end> |
<topic_start> |
step 2d: add linux platform code (.h+.cc) |
we recommend you edit the linux code using an IDE with |
c++ integration. the instructions below are for |
visual studio code with the “c/c++” and “cmake” extensions |
installed, but can be adjusted for other IDEs. |
before editing the linux platform code in an IDE, |
first make sure that the code has been built at least once |
(in other words, run the example app from your flutter |
IDE/editor, or in a terminal execute |
cd hello/example; flutter build linux). |
then use the following steps: |
the linux platform code for your plugin is located in |
flutter/ephemeral/.plugin_symlinks/hello/linux/. |
you can run the example app using flutter run. |
note: creating a runnable flutter application |
on linux requires steps that are part of the flutter |
tool, so even if your editor provides CMake |
integration building and running that way won’t |
work correctly. |
<topic_end> |
<topic_start> |
step 2e: add macOS platform code (.swift) |
we recommend you edit the macOS code using xcode. |
before editing the macOS platform code in xcode, |
first make sure that the code has been built at least once |
(in other words, run the example app from your IDE/editor, |
or in a terminal execute |
cd hello/example; flutter build macos). |
then use the following steps: |
the macOS platform code for your plugin is located in |
Pods/Development Pods/hello/../../example/macos/Flutter/ephemeral/.symlinks/plugins/hello/macos/Classes |
in the project navigator. (if you are using sharedDarwinSource, |
the path will end with hello/darwin/Classes instead.) |
you can run the example app by pressing the run (▶) button. |
<topic_end> |
<topic_start> |
step 2f: add windows platform code (.h+.cpp) |
we recommend you edit the windows code using visual studio. |
before editing the windows platform code in visual studio, |
first make sure that the code has been built at least once |
(in other words, run the example app from your IDE/editor, |
or in a terminal execute |
cd hello/example; flutter build windows). |
then use the following steps: |
the windows platform code for your plugin is located in |
hello_plugin/Source files and hello_plugin/Header files in |
the solution explorer. |
you can run the example app by right-clicking hello_example in |
the solution explorer and selecting set as startup project, |
then pressing the run (▶) button. important: after |
making changes to plugin code, you must select |
build > build solution before running again, otherwise |
an outdated copy of the built plugin will be run instead |
of the latest version containing your changes. |
<topic_end> |
<topic_start> |
step 2g: connect the API and the platform code |
finally, you need to connect the API written in dart code with |
the platform-specific implementations. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.