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

Subsequent row is open after Slidable row is dismissed. #472

Open
adammal opened this issue Apr 19, 2024 · 1 comment
Open

Subsequent row is open after Slidable row is dismissed. #472

adammal opened this issue Apr 19, 2024 · 1 comment

Comments

@adammal
Copy link

adammal commented Apr 19, 2024

Hello and thank you for the great library.

I've stumbled upon an issue in flutter_slidable: ^3.1.0 when dismissing a row and I've created a minimal project to reproduce it in-case it's helpful.
https://github.com/adammal/slidable_dismiss_problem

Android.Emulator.-.Pixel_4_API_33_5554.2024-04-19.16-38-13.mp4

Action

The user slides to dismiss a row in a series of Slidable rows.

Expected Behaviour

The row is dismissed and all remaining rows remain closed.

Actual Behaviour

The row is dismissed but the subsequent row is opened and remains open after the dismissal is complete.

Notes

I've also discovered that this is only an issue when a SlidableController is assigned to the Slideable's by the user.
If I remove the controller from the Slidable it works as expected.

Code in question

Slidable(
  key: UniqueKey(),
  controller: _slidableController,
  endActionPane: ActionPane(
    motion: const ScrollMotion(),
    dismissible: DismissiblePane(
      onDismissed: () => widget.onDelete(widget.value),
    ),
    children: [
      SlidableAction(
        onPressed: (context) => widget.onDelete(widget.value),
        label: 'Delete',
      )
    ],
  ),
  child: Container(
    constraints: const BoxConstraints(
      minHeight: 50,
      minWidth: double.infinity
    ),
    color: Colors.blue,
    child: Center(child: Text(widget.value.toString())),
  ),
),

Am I doing something wrong in the way i've implemented this?

Any help would be greatly appreciated.

@sbalex27
Copy link

sbalex27 commented Jul 17, 2024

Same problem here. @adammal

image

Provisional solution: Remove _slidableController and use the scoped default controller (remember wrap in builder widget to access to inherited controller).
image

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

2 participants