Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slidable open Not effective ? #455

Open
daijintaozz opened this issue Jan 11, 2024 · 0 comments
Open

Slidable open Not effective ? #455

daijintaozz opened this issue Jan 11, 2024 · 0 comments

Comments

@daijintaozz
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant