Skip to content

Conversation

@ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Mar 8, 2025

Test Code

import flet as ft


def main(page: ft.Page):
    page.title = "ReorderableListView Demo"

    # the primary color is the color of the reorder handle
    page.theme = page.dark_theme = ft.Theme(
        color_scheme=ft.ColorScheme(primary=ft.Colors.BLUE)
    )
    get_color = (
        lambda i: ft.Colors.ERROR if i % 2 == 0 else ft.Colors.ON_ERROR_CONTAINER
    )

    page.add(
        ft.ReorderableListView(
            expand=True,
            build_controls_on_demand=False,
            on_reorder=lambda e: print(f"Reordered from {e.old_index} to {e.new_index}"),
            show_default_drag_handles=True,
            controls=[
                ft.ReorderableDraggable(
                    index=i,
                    content=ft.ListTile(
                        title=ft.Text(f"Item {i}", color=ft.Colors.BLACK),
                        leading=ft.Icon(ft.Icons.CHECK, color=ft.Colors.RED),
                        bgcolor=get_color(i),
                    ),
                )
                for i in range(10)
            ],
        )
    )


ft.app(main)

Summary by Sourcery

Adds the ability to customize drag handles in the ReorderableListView control by introducing the show_default_drag_handles and mouse_cursor properties.

New Features:

  • Adds the ability to hide default drag handles in ReorderableListView.
  • Adds the ability to customize the mouse cursor when hovering over drag handles in ReorderableListView.

Summary by Sourcery

Adds the ability to customize drag handles in the ReorderableListView control by introducing the show_default_drag_handles and mouse_cursor properties.

New Features:

  • Adds the ability to hide default drag handles in ReorderableListView.
  • Adds the ability to customize the mouse cursor when hovering over drag handles in ReorderableListView.

@ndonkoHenri ndonkoHenri added this to the Flet v0.28.0 milestone Mar 12, 2025
@ndonkoHenri ndonkoHenri added controls feature request Suggestion/Request for additional feature labels Mar 12, 2025
@ndonkoHenri ndonkoHenri moved this to 🏗 In progress in Flet Development Mar 12, 2025
@ndonkoHenri ndonkoHenri marked this pull request as ready for review March 17, 2025 14:11
@ndonkoHenri ndonkoHenri moved this from 🏗 In progress to 👀 In review in Flet Development Mar 17, 2025
@FeodorFitsner
Copy link
Contributor

Can you please update from main and resolve conflicts?

@github-project-automation github-project-automation bot moved this from 👀 In review to 🔖 Ready in Flet Development Apr 5, 2025
@FeodorFitsner FeodorFitsner merged commit add9c61 into main Apr 5, 2025
1 of 2 checks passed
@github-project-automation github-project-automation bot moved this from 🔖 Ready to ✅ Done in Flet Development Apr 5, 2025
@FeodorFitsner FeodorFitsner deleted the ndonkoHenri/reorderable-listener branch April 5, 2025 00:10
FeodorFitsner pushed a commit that referenced this pull request Apr 5, 2025
* initial commit

* `ReorderableListView`: mouse_cursor, show_default_drag_handles

* generated files

* flutter 3.29.0
FeodorFitsner added a commit that referenced this pull request Jun 19, 2025
commit 2a1facb
Author: Henning Wilmer <57907680+HenningCode@users.noreply.github.com>
Date:   Thu Jun 12 18:37:58 2025 +0200

    Change the type alias from a class to a real rename (#5258)

commit 8f83b45
Author: PythonPan <2292551082@qq.com>
Date:   Fri Jun 13 00:29:49 2025 +0800

    Fix  page.run_thread does not receive kwargs (#5318) (#5320)

commit bf09a2c
Author: Antón Fernández Pérez <134967595+SIRGPrice@users.noreply.github.com>
Date:   Wed Jun 11 21:16:41 2025 +0200

    Update remove_control_payload.dart (#5353)

    Android apk app randomly generates this error in logcat:

    E  [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
                                                                                                        #0      new List.from (dart:core-patch/array_patch.dart:30)
                                                                                                        #1      new RemoveControlPayload.fromJson (package:flet/src/protocol/remove_control_payload.dart:7)
                                                                                                        #2      appReducer (package:flet/src/reducers.dart:376)
                                                                                                        #3      Store._createReduceAndNotify.<anonymous closure> (package:redux/src/store.dart:235)
                                                                                                        #4      Store.dispatch (package:redux/src/store.dart:267)
                                                                                                        #5      FletServer._onMessage (package:flet/src/flet_server.dart:265)
                                                                                                        #6      FletTcpSocketServerProtocol._onMessage (package:flet/src/flet_server_protocol_tcp_socket.dart:125)
                                                                                                        #7      FletTcpSocketServerProtocol.connect.<anonymous closure> (package:flet/src/flet_server_protocol_tcp_socket.dart:94)
                                                                                                        #8      _RootZone.runUnaryGuarded (dart:async/zone.dart:1778)
                                                                                                        #9      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
                                                                                                        #10     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312)
                                                                                                        #11     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798)
                                                                                                        #12     _StreamController._add (dart:async/stream_controller.dart:663)
                                                                                                        #13     _StreamController.add (dart:async/stream_controller.dart:618)
                                                                                                        #14     _Socket._onData (dart:io-patch/socket_patch.dart:2904)
                                                                                                        #15     _RootZone.runUnaryGuarded (dart:async/zone.dart:1778)
                                                                                                        #16     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381)
                                                                                                        #17     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312)
                                                                                                        #18     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798)
                                                                                                        #19     _StreamController._add (dart:async/stream_controller.dart:663)
                                                                                                        #20     _StreamController.add (dart:async/stream_controller.dart:618)
                                                                                                        #21     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:2323)
                                                                                                        #22     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1646)
                                                                                                        #23     _microtaskLoop (dart:async/schedule_microtask.dart:40)
                                                                                                        #24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49)

commit 1c040ef
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Sun May 18 20:13:06 2025 -0400

    Preparing Flet v0.28.3 release (#5306)

    * Fix images displaying in web mode with non-empty page name

    Fix #5198

    * Fix page.on_view_pop event handling

    Fix #5302

    * Fix FilePicker.save_file() for Android and iOS

    Fix #5301

    * PubSub: allow multiple subscribers per session, per topic

    Close #5303

    * Bump version to 0.28.3, updated changelog

commit 69e4e10
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Sat May 10 13:49:30 2025 -0700

    Prepare Flet 0.28.2 (#5295)

    * Added missing imports into `__init__.py`

    * Changelog, bumped version to 0.28.2

    * fix WindowDragArea

    * update code in readme

    * Upated changelog

    ---------

    Co-authored-by: ndonkoHenri <robotcoder4@protonmail.com>

commit 7ce8e48
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Thu May 8 12:38:37 2025 -0700

    Update .appveyor.yml

commit deb38c7
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Thu May 8 09:11:14 2025 -0700

    v0.28.0 release notes (#5286)

    * v0.28.0 release notes

    * Fix "Fixed:"

commit fcc712f
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Wed May 7 10:29:03 2025 -0700

    `View.can_pop` and `View.on_confirm_pop` (#5284)

    * View.can_pop and View.on_confirm_pop

    * Dismissible and View: added 5 minutes timeout for confirm callbacks

commit c3d550a
Author: Owen McDonnell <7119543+OwenMcDonnell@users.noreply.github.com>
Date:   Sat May 3 16:41:10 2025 -0700

    Update CONTRIBUTING.md (#5268)

    note about activating .zprofile variables.

commit f4b83ae
Author: bl1nch <130155870+bl1nch@users.noreply.github.com>
Date:   Tue Apr 29 07:31:08 2025 +0600

    UTF-8 encoding for pyproject.toml (#5203)

commit e3f4d16
Author: Feodor Fitsner <feodor@appveyor.com>
Date:   Fri Apr 4 17:17:48 2025 -0700

    Update reorderable_list_view.dart

commit add9c61
Author: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Date:   Sat Apr 5 02:10:23 2025 +0200

    feat: custom `ReorderableListView` drag handle listeners (#5051)

    * initial commit

    * `ReorderableListView`: mouse_cursor, show_default_drag_handles

    * generated files

    * flutter 3.29.0

commit 440009d
Author: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
Date:   Sat Apr 5 02:04:32 2025 +0200

    feat: expose events (`on_double_tap`, `on_pan_start`) in `WindowDragArea` (#5043)

    * improve events typing in gesture_detector.py

    * window.start_dragging

    * delete window_drag_area.dart

    * rework WindowDragArea inheriting from GestureDetector

    * export more utils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls feature request Suggestion/Request for additional feature

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants