We have just released Flet 0.1.41 with drag-and-drop support and other neat features such as absolute positioning of controls inside stack and clickable container!
Drag and Drop
Making drag-and-drop in Flet is a real joy - thanks to a smart drag-and-drop implementation in Flutter! You just have "draggable" control which could be dragged to a "drag target" which calls
on_accept event handler when draggable is dropped.
Take a look at Drag-and-Drop example.
Absolute positioning inside Stack
All visible controls now have
bottom properties to let them be absolutely positioned inside
Stack, for example:
from flet import Container, Page, Stack, Text, colors
def main(page: Page):
page.horizontal_alignment = "center"
page.vertical_alignment = "center"
Text("2", color=colors.WHITE, right=0),
Text("3", color=colors.WHITE, right=0, bottom=0),
Text("4", color=colors.WHITE, left=0, bottom=0),
Text("5", color=colors.WHITE, left=40, top=35),
Container control has got
on_click event which allows you to make a button from any control and with a beautiful material ripple effect when
ink is set to
See source code for the example above.