IOS "Add To Siri" button in Flutter with a Platform View

  Рет қаралды 1,724

I code you to death

I code you to death

Күн бұрын

In case you'll ever need to implement the "add to Siri" button in #flutter then here is an example solution with an explanation. This solution uses Platform views, so this video can also saver as an introduction to them. Potentially, other solutions are also possible (i.e. with PlaformChannels). In case you have a different approach, share it in the comments. Either way, we have to write some of #ios #swift or Objective-C.
There's yet no plugin for this, so feel free to create one in case you have time for maintaining plugins! :D
Gist for the swift part, excluding PlatformView part: gist.github.co...

Пікірлер: 6
@icodeyoutodeath
@icodeyoutodeath 2 жыл бұрын
Please note, I'm not an iOS dev and so, although, the swift code you see here will work if you plan to use it as is, there are some issues as I learned at a PR. First, the constraints are reversed. Secondly, in case you need to access the actual frame size, then you can get it in the `layoutSubviews()` method. However, I"m not accessing the frame, and therefore this method is not necessary and the constraints can be set up at `init`. Finally, the method that gets a `RootViewController` is way overcomplicated. You can just directly get the root controller in one line and all that code with atabBarController` is not necessary. Well, that was a piece of code I copied from somewhere. :D Good luck!
@funniyatoons
@funniyatoons 2 жыл бұрын
Can you please share the github repo here?
@icodeyoutodeath
@icodeyoutodeath 2 жыл бұрын
@@funniyatoons Here's a gist for the swift part excluding the PlatformVIew set up: gist.github.com/akvus/bf1c2936b85544c1a4dbc78e0e8b6baf
@zbkino
@zbkino Жыл бұрын
@@icodeyoutodeath hello! Thanks for your video! Could you also share the code of other files you a showing in the video please?
@anguinan
@anguinan 11 ай бұрын
this allows you to say something to siri and then some code in your app gets executed?
@2mvX
@2mvX Жыл бұрын
Thank you for this tutorial. How to perform certain action on shortut's run? I've tried by trying to get information about incoming userActivity but it didn't work. func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
Isolates vs. threads: what you need to know
16:40
I code you to death
Рет қаралды 1,1 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 51 МЛН
12 GENUINELY USEFUL Siri Commands You Probably Didn’t Know (2023)
11:58
Proper Honest Tech
Рет қаралды 348 М.
Trying out Dart's new Isolate.run() method
12:55
I code you to death
Рет қаралды 3,2 М.
Lecture 1 | Stanford CS193p 2023
1:11:04
Stanford CS193p
Рет қаралды 122 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН