flet icon indicating copy to clipboard operation
flet copied to clipboard

CustomPaint control

Open FeodorFitsner opened this issue 3 years ago • 3 comments

https://www.raywenderlich.com/25237210-building-a-drawing-app-in-flutter https://medium.com/flutter-community/a-deep-dive-into-custompaint-in-flutter-47ab44e3f216

FeodorFitsner avatar Aug 19 '22 23:08 FeodorFitsner

Yes please! Considering using Flet as the go-to GUI tool for my introductory Python course, and a painter would be an invaluable tool for my students to play around with.

mimavox avatar Oct 15 '22 12:10 mimavox

Sure, my only concern is to how to deal with a canvas's "size" property which is available on Flutter side in paint() method and, presumably, be useful on a Python (server) side. 😕

FeodorFitsner avatar Oct 15 '22 17:10 FeodorFitsner

Maybe we could offer two options:

  1. Flet developer knows the size of the canvas (say, it's a widget with page's width/height or a widget with a fixed size) and can provide drawing instructions right away.
  2. Flet developer doesn't know canvas size, so their provide drawing instructions in custom_paint.on_paint event handler which brings canvas size in its event object.

FeodorFitsner avatar Oct 15 '22 17:10 FeodorFitsner

https://flet.dev/blog/canvas

FeodorFitsner avatar May 15 '23 16:05 FeodorFitsner