nateshmbhat / touchable

The only flutter library to add gestures and animations to custom shapes you draw on your canvas.
https://pub.dev/packages/touchable
Mozilla Public License 2.0
233 stars 80 forks source link

How to draw text on the TouchyCanvas? #25

Closed S-Man42 closed 3 years ago

S-Man42 commented 3 years ago

Is there a way to use a TextPainteron the canvas? Or is there a way to access the normal Canvasmember to do this?

andraantariksa commented 2 years ago

Ah yes, closing issue without any context. Mind to share your solution?

S-Man42 commented 2 years ago

Thanks for your very kind, non-offending request. That's the way making people help you with pleasure... 🙄

Well, for me, it works to take the Canvas instance, which is used to create a TouchyCanvas, directly to draw some text on it. So, TouchyCanvas is used for drawing touchy Rects and the normal Canvas is used to draw text. Don't know if you could call it a solution.

https://github.com/S-Man42/GCWizard/blob/9c5e2d916fe2ac1c48e21659f23a718fc73e8145/lib/widgets/tools/games/sudoku/sudoku_board.dart#L110