パッケージ、リポジトリ、アプリカテゴリを検索

drag_and_drop_lists のカバー
パッケージ詳細v0.4.2

drag_and_drop_lists

2段階のリストのドラッグアンドドロップによる並べ替えを可能にするFlutterパッケージ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2.1万
いいね数
457
Pub ポイント
150

パッケージをインストール

flutter pub add drag_and_drop_lists

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

2段階のネストされたリスト内でドラッグアンドドロップによる再順序付けを可能にするFlutterパッケージです。複数のレベル間でアイテムを再配置するための直感的なユーザー操作をサポートしており、階層データの整理に最適です。Android、iOS、Web、macOS、Windows、Linuxなど、すべての主要プラットフォームと互換性があります。シンプルさとパフォーマンスを重視して設計されており、複雑なセットアップなしに既存のFlutterアプリにシームレスに統合できます。最小限のコードでインタラクティブなリスト構造を簡単に実装できます。ソースコードはGitHub上で公開されており、透明性と貢献を促進しています。

用途

  • ネストされたタスクリストの並べ替え
  • カスタマイズ可能なダッシュボードの構築
  • 並べ替え可能なカテゴリ-サブカテゴリ構造の作成
  • インタラクティブなToDoアプリケーションの設計
  • ドラッグアンドドロップによるファイルまたはアイテムの整理の実装

主な機能

  • 2段階リストのサポート
  • 階層間のドラッグアンドドロップ
  • プラットフォーム非依存の実装
  • 必要なボイラープレートが最小限です
  • 組み込みアニメーション処理
  • パブリックな GitHub リポジトリ

適している対象

  • 階層的なUIを構築する開発者
  • 動的なリストの再順序付けを必要とするアプリ
  • ネストされたデータ構造を持つプロジェクト
  • UI重視の生産性ツール
  • オープンソースで保守可能なソリューションを求めるチーム

注意事項

  • 2レベルのネストまでに制限
  • 複雑なレイアウトにはカスタムスタイルの適用が必要になる場合があります
  • 非常に大きなリストではパフォーマンスが低下する可能性があります
  • 基本的なドラッグ以外のタッチジェスチャーには最適化されていません
  • ドロップターゲット用の組み込み検証なし

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

drag_and_drop_lists

Two-level drag and drop reorderable lists.

"Buy Me A Coffee"

Features

  • Reorder elements between multiple lists
  • Reorder lists
  • Drag and drop new elements from outside of the lists
  • Vertical or horizontal layout
  • Use with drag handles, long presses, or short presses
  • Expandable lists
  • Can be used in slivers
  • Prevent individual lists/elements from being able to be dragged
  • Easy to extend with custom layouts

Basic list Drag and drop expansion tiles Drag and drop using drag handles Drag and drop new lists and new items Drag and drop horizontal lists Drag and drop list tiles Drag and drop lists using slivers

Usage

To use this plugin, add drag_and_drop_lists as a dependency in your pubspec.yaml file. For example:

dependencies:
  drag_and_drop_lists: ^0.4.0

Now in your Dart code, you can use: import 'package:drag_and_drop_lists/drag_and_drop_lists.dart';

To add the lists, add a DragAndDropLists widget. Set its children to a list of DragAndDropList. Likewise, set the children of DragAndDropList to a list of DragAndDropItem. For example:

  // Outer list
  List<DragAndDropList> _contents;

  @override
  void initState() {
    super.initState();

    // Generate a list
    _contents = List.generate(10, (index) {
      return DragAndDropList(
        header: Text('Header $index'),
        children: <DragAndDropItem>[
          DragAndDropItem(
            child: Text('$index.1'),
          ),
          DragAndDropItem(
            child: Text('$index.2'),
          ),
          DragAndDropItem(
            child: Text('$index.3'),
          ),
        ],
      );
    });
  }

  @override
  Widget build(BuildContext context) {
    // Add a DragAndDropLists. The only required parameters are children,
    // onItemReorder, and onListReorder. All other parameters are used for
    // styling the lists and changing its behaviour. See the samples in the
    // example app for many more ways to configure this.
    return DragAndDropLists(
      children: _contents,
      onItemReorder: _onItemReorder,
      onListReorder: _onListReorder,
    );
  }

  _onItemReorder(int oldItemIndex, int oldListIndex, int newItemIndex, int newListIndex) {
    setState(() {
      var movedItem = _contents[oldListIndex].children.removeAt(oldItemIndex);
      _contents[newListIndex].children.insert(newItemIndex, movedItem);
    });
  }

  _onListReorder(int oldListIndex, int newListIndex) {
    setState(() {
      var movedList = _contents.removeAt(oldListIndex);
      _contents.insert(newListIndex, movedList);
    });
  }

For further examples, see the example app or view the example code directly.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト