Query: Smooth DismissiblePane Implementation within ActionPane?

オープン
#476 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
15/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
flutter
領域
mobile

調査の方向性

The report concerns how ActionPane, DismissiblePane and SlidableAction interact inside a Slidable with DrawerMotion on the start pane, so start with the code that handles the start pane's dismissible and its children. Reproduce with the snippet in the issue, swiping past the dismissThreshold with no children acting, and see where the drag stops. Done means a pane with only a DismissiblePane can be dismissed in one smooth swipe, with confirmDismiss returning false still closing the pane.

索引モデルが issue の本文から書いたものです。

説明

Hello,

Firstly, a huge thank you for this incredible package!

In my application, I have a list of products. I aim for users to validate a product by swiping from left to right, or be able to edit/delete it by swiping from right to left.

However, I'm encountering difficulty implementing just the DismissiblePane for the validation functionality. It seems ActionPane requires children, and therefore, the motion from the user is not smooth to validate the product. When a user swipes, they're initially obstructed by the ActionPaneAction, and only then can they dismiss the tile.

Do you know if it's possible to exclusively employ a DismissiblePane within an ActionPane?
Thank you!

Here is my minimal code :

Slidable(
    key: ValueKey(index),
    groupTag: '0',
    startActionPane: ActionPane(
      motion: const DrawerMotion(),
      dismissible: DismissiblePane(
          key: const ValueKey(0),
          closeOnCancel: true,
          dismissThreshold: 0.8,
          confirmDismiss: () async {
            doSth();
            return false;
          },
          onDismissed: () {
            print("Panel dismiss called");
          }),
      children: [
        SlidableAction(
          onPressed: (_) {}, // I don't want to perform any action here, but the motion do a stop here
          backgroundColor: Colors.green,
          foregroundColor: Colors.white,
          icon: Icons.done,
        ),
      ],
    ),
    endActionPane: ActionPane(
      extentRatio: 0.4,
      motion: const ScrollMotion(),
      children: [
        SlidableAction(
          onPressed: (_) {},
          backgroundColor: Colors.blue,
          foregroundColor: Colors.white,
          icon: Icons.edit,
        ),
        SlidableAction(
          onPressed: (_) {
            product.isVisible = false;
            setState(() {});
            _deleteSelectedItems();
          },
          backgroundColor: Colors.red,
          foregroundColor: Colors.white,
          icon: Icons.delete,
        ),
      ],
    ),
    child: ChildProduct(product),
  );
主要言語
Dart
スター
2.9k
フォーク
646
平均マージ
5分
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

letsar/flutter_slidable のほかの issue

letsar/flutter_slidable の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。