Skip to content

Commit e504d64

Browse files
committed
Fix formatting and image
1 parent 2e01f3d commit e504d64

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed
Binary file not shown.
Binary file not shown.

docs/ff-concepts/advanced/method-channels.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ This message flow is asynchronous and decoupled:
8282
8383
### Example Message Flow
8484
85-
![method-channels.png](imgs/method-channels.png)
85+
![method-channels.avif](imgs/method-channels.avif)
8686
8787
This design ensures clear separation between platform and UI logic, and it keeps the UI thread non-blocking for both Dart and native sides. It also makes the communication extensible—you can define as many methods as you need over a single channel or use multiple channels for modular organization.
8888
@@ -341,9 +341,11 @@ FlutterFlow is a visual development platform that generates complete Flutter app
341341
342342
**1.1 Initialize the Plugin**
343343
344-
Use the Flutter CLI to create a new plugin:
344+
Use the Flutter CLI to create a new plugin:
345+
345346
```jsx
346347
flutter create --template=plugin --platforms=android,ios my_custom_plugin
348+
```
347349
348350
This command sets up a plugin project with the necessary structure for both Android and iOS platforms.
349351
@@ -374,11 +376,11 @@ To integrate your custom plugin into a FlutterFlow project:
374376
3. In the **Settings** panel on the right, scroll to **Dependencies**.
375377
4. Add your plugin using the Git URL:
376378
377-
```yaml
378-
my_custom_plugin:
379-
git:
380-
url: https://github.com/yourusername/my_custom_plugin.git
381-
```
379+
```yaml
380+
my_custom_plugin:
381+
git:
382+
url: https://github.com/yourusername/my_custom_plugin.git
383+
```
382384
383385
5. In the code editor, import your plugin:
384386
@@ -400,13 +402,12 @@ With the plugin integrated, you can now create Custom Actions to leverage its fu
400402
1. Define a new Custom Action in FlutterFlow.
401403
2. In the code editor, implement the action using your plugin. For example:
402404

403-
```js
404-
Future<int> getBatteryLevel() async {
405-
final batteryLevel = await MyCustomPlugin.getBatteryLevel();
406-
return batteryLevel;
407-
}
408-
409-
```
405+
```jsx
406+
Future<int> getBatteryLevel() async {
407+
final batteryLevel = await MyCustomPlugin.getBatteryLevel();
408+
return batteryLevel;
409+
}
410+
```
410411

411412

412413
3. Compile the custom code to ensure there are no errors.

0 commit comments

Comments
 (0)