Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
flet / controls / core / reorderable_draggable.py
Size: Mime:
from flet.controls.adaptive_control import AdaptiveControl
from flet.controls.base_control import control
from flet.controls.constrained_control import ConstrainedControl
from flet.controls.control import Control


@control("ReorderableDraggable")
class ReorderableDraggable(ConstrainedControl, AdaptiveControl):
    """
    Used to drag an item in a [`ReorderableListView`][flet.ReorderableListView].

    It creates a listener for a drag immediately following a pointer down
    event over the given [`content`][(c).] control.

    Raises:
        AssertionError: If [`content`][(c).] is not visible.
    """

    index: int
    """
    The index of the associated item that will be dragged in the list.
    """

    content: Control
    """
    The control for which the application would like to respond to a tap and
    drag gesture by starting a reordering drag on a reorderable list.
    """

    def before_update(self):
        super().before_update()
        assert self.content.visible, "content must be visible"