From a37672ff5580df8be9dc84e0dc84e7720f07d41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Gangs=C3=B8?= Date: Wed, 23 Aug 2023 11:28:59 +0200 Subject: [PATCH] Deployed 3985792 with MkDocs version: 1.5.2 --- contributing/example/index.html | 14 ++++++++------ index.html | 2 +- sitemap.xml.gz | Bin 127 -> 127 bytes 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/contributing/example/index.html b/contributing/example/index.html index db4c7add..1e7d955e 100644 --- a/contributing/example/index.html +++ b/contributing/example/index.html @@ -153,17 +153,19 @@

Open pigeons/playback_platform Anything we add here will be callable from flutter and has to be implemented on the native side.

Let's add a setVolume() function somewhere, with a double to represent the volume from 0.0 to 1.0. You almost always need to include a playerId, in order to know which player to work with (you'll see later).

-

We attribute the method with a @ObjCSelector with this syntax: functionName:secondParam:. This isn't strictly necessary but it helps keep the iOS code a bit cleaner.

+

We attribute the method with a @ObjCSelector with this syntax: functionName:secondParam:. This isn't strictly necessary but it helps keep the iOS code a bit cleaner. +The @async makes the generated dart code return a Future, allowing us to await it if necessary.

So something like this:

@HostApi()
 abstract class PlaybackPlatformPigeon {
    // ... other methods
 
-  @ObjCSelector("setVolume:volume:")
-  void setVolume(String playerId, double volume);
-
-   // ... other methods
-}
+  @async
+  @ObjCSelector("setVolume:volume:")
+  void setVolume(String playerId, double volume);
+
+   // ... other methods
+}
 

Tip: You can use advanced argument types (see MediaItem, etc), pigeon will generate iOS/Android code for those too. But everything needs to be defined inside this one .dart file, as 'import' is not supported.

After any edits to playback_platform_pigeon.dart we need to run pigeon to generate everything:

diff --git a/index.html b/index.html index ddbaff19..c5ea4607 100644 --- a/index.html +++ b/index.html @@ -201,5 +201,5 @@

Installation

diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 0f7509b332bc08095c062971758b4702c7dcacbf..1e87a63b3704f4319d817d6599615b8f1cae1b55 100644 GIT binary patch delta 12 Tcmb=gXOr*d;E29Bk*yK{7|R3u delta 12 Tcmb=gXOr*d;D|auk*yK{7`_Ae