Slidable open Not effective ?

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

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

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

評価

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

調査の方向性

The reporter's snippet wraps Slidable in a GestureDetector, so the context in onLongPress sits above the Slidable subtree and Slidable.of(context) returns null. Start by reading how Slidable.of looks up its ancestor in the package source, then reproduce with a minimal ListView like the one in the issue. Done means either a documented pattern for opening a pane from outside the item, such as a Builder inside child, or a clearer failure than a silent null. The issue is over 1,000 days old with no comments, and the desired behaviour is not settled, so confirm the scope with a maintainer first.

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

説明

When I can't open ActionPanel for a long time.

Here is my main code:

ListView.builder(
                itemCount: myPositions.length,
                padding: EdgeInsets.zero,
                itemBuilder: (ctx, index) {
                  return GestureDetector(
                    onLongPress: () {
                       Slidable.of(context)?.openEndActionPane();
                    },
                    child: Slidable(
                      groupTag: MyPositionView.routeName,
                      key: ValueKey(index),
                      direction: Axis.horizontal,
                      endActionPane: ActionPane(
                        extentRatio: 0.2,
                        motion: const ScrollMotion(),
                        children: [
                          Builder(builder: (context) {
                            return Container(
                              margin: EdgeInsets.symmetric(vertical: 6.w),
                              child: Column(
                                children: [
                             
                                  Expanded(
                                    child: TextButton(
                                      onPressed: () => deletePosition(index, context),
                                      style: TextButton.styleFrom(
                                        backgroundColor: const Color(0xff4077DE),
                                        foregroundColor: Colors.white,
                                      ),
                                      child: const Icon(Icons.delete_forever),
                                    ),
                                  ),
                                ],
                              ),
                            );
                          }),
                        ],
                      ),
                      child: MyWidget(),
                    ),
                  );
                },
              )

It is very unreasonable to ensure that the context can only be used with Slidable. of (context).

主要言語
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 を短くまとめたダイジェスト。