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

Delete animation problem #58

Open
aurokk opened this issue Mar 8, 2023 · 0 comments
Open

Delete animation problem #58

aurokk opened this issue Mar 8, 2023 · 0 comments
Labels
fidelity viewed We have viewd this issue or PR and we will give a response or fix soon

Comments

@aurokk
Copy link

aurokk commented Mar 8, 2023

Hey!
Thank you for the package.
It seems there is a bug with the animations — when I touch the screen during the delete animation the cell loses its red color and some visual artifacts appear after it :-)
Please take a look.


Demo

Simulator.Screen.Recording.-.iPhone.11.Pro.Max.-.2023-03-08.at.15.33.04.mp4

Repro

import 'package:flutter/cupertino.dart';
import 'package:flutter_swipe_action_cell/flutter_swipe_action_cell.dart';

class X extends StatefulWidget {
  @override
  State<X> createState() => _XState();
}

class _XState extends State<X> {
  var items = List<String>.empty();

  @override
  void initState() {
    super.initState();
    items = List.generate(10, (index) => 'Item $index');
  }

  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      home: CupertinoPageScaffold(
        child: SafeArea(
          child: CustomScrollView(
            slivers: [
              SliverList(
                delegate: SliverChildBuilderDelegate(
                  childCount: items.length,
                  (_, index) {
                    return SwipeActionCell(
                      deleteAnimationDuration: 10000,
                      key: ValueKey(items[index]),
                      trailingActions: <SwipeAction>[
                        SwipeAction(
                          title: "delete",
                          onTap: (CompletionHandler handler) async {
                            await handler(true);
                            items.removeAt(index);
                            setState(() {});
                          },
                          color: CupertinoColors.destructiveRed,
                        ),
                      ],
                      child: Container(
                        height: 30,
                        child: Text(items[index]),
                        color: CupertinoColors.white,
                      ),
                    );
                  },
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

void main() {
  runApp(X());
}

I use the latest 3.1.0 version

@luckysmg luckysmg added viewed We have viewd this issue or PR and we will give a response or fix soon fidelity labels Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fidelity viewed We have viewd this issue or PR and we will give a response or fix soon
Projects
None yet
Development

No branches or pull requests

2 participants