My pinball is just the beginnings of a work in progress, so I am not sure if it would be a good example for sharing.
My code is too fresh and probably needs revising, so I do not want to steer you on the wrong path.
I will see if I can scratch out an example of how the flipper is working so far, then you can take it from there.
Hang on, I'll be back...
Okay man, coming back to this thread I paid more attention to the title and noticed that you are looking for the 'best way'.
Sorry, but this is probably not the best way, but it may be enough to get you started.
I easily get bored with projects and find myself hopping back and forth from my WIPs.
This one is laying around, so I cannibalized the flipper controls for use in this example.
I was not happy with the bounce off the flippers, so maybe some math wizard can modify this a bit.
Anyway... see attached zip.
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1