Adonit / LAMY-iPadOS-SDK

0 stars 0 forks source link

Flutter Integration #3

Open AlexanderThiele opened 1 month ago

AlexanderThiele commented 1 month ago

Hey!

Do you have any experience or examples to use the Events inside a Flutter App? Especially to use the Events within a Listener-Widget in Flutter.

Thanks!

AlexanderThiele commented 1 month ago

I have another question regarding the connection. i can enable the Connection via the enable method but how do i establish a connection to the pencil?

When i read the docs, i can monitor the connection state but there is no event happening after i enabled the sdk. I want to build my own UI with flutter and only want to exchange data to the native iPad OS.

My question now is, how to i connect to the pencil?

adonitDevel commented 1 month ago

Hi @AlexanderThiele, Sorry, we don't have any experience with Flutter.

You can build your UI to tell users to Hold the stylus's tip and press then call this function. "startDiscoveryAndImmediatelyConnect", and you will receive a notification if the stylus is connected.

AlexanderThiele commented 1 month ago

@adonitDevel thanks, found it as well. Maybe you could update the docs.

AlexanderThiele commented 1 month ago

Regarding Flutter, if you want to support flutter, you have to attach the pencil touch events to the flutter engine instead of capturing them before they hit the flutter engine. The Apple Pencil works well with flutter. Maybe you should keep an eye on their flutter integration.

rudramistry001 commented 1 month ago

u can use provider it is a state management library in Flutter

AlexanderThiele commented 1 month ago

Hey @rudramistry001 that makes no sense. in Flutter you want to have the gesture coordinates on the widget in it's local coordinates relative to their parents.

rudramistry001 commented 1 month ago

ok got it

scheipers commented 1 week ago

Actually, @AlexanderThiele did write and open-source a plugin for Flutter – @AlexanderThiele don't be shy to share it here: https://pub.dev/packages/lamy_pencil_flutter Thanks a lot again!