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

How can i apply slide navigation to listView items. #48

Open
KuldeepAIP opened this issue May 2, 2022 · 0 comments
Open

How can i apply slide navigation to listView items. #48

KuldeepAIP opened this issue May 2, 2022 · 0 comments

Comments

@KuldeepAIP
Copy link

Hi
Basically i have simply screen with 1 question and dynamic answers and for that i have uses 1 text and ListView for dynamic answers so i want to animate question answers from right to left.

1st question ==> all answers animate from right to left.
2nd question ==> all answers animate from right to left.

I have do the below but it animate always 1st time. Animation not applied for rest of the questions answers listview.

return AnimationLimiter(
      child: ListView.builder(
        shrinkWrap: true,
        physics: const NeverScrollableScrollPhysics(),
        scrollDirection: Axis.vertical,
        itemCount: answers!.answers![queCount].options!.length,
        itemBuilder: (ctx, i) {
          return AnimationConfiguration.staggeredList(
            position: i,
            duration: const Duration(milliseconds: 1000),
            child: SlideAnimation(
              horizontalOffset: 500.0,
              child: Container(
                margin: const EdgeInsets.symmetric(vertical: 8),
                padding: const EdgeInsets.all(12),
                alignment: Alignment.center,
                decoration: BoxDecoration(
                  gradient: answers!.answers![queCount].options![i].checked!
                      ? const RadialGradient(
                          center: Alignment(-0.8, -0.6),
                          colors: [
                            Color.fromRGBO(0, 174, 239, 0.22),
                            Color.fromRGBO(0, 174, 239, 0)
                          ],
                          radius: 4.8,
                        )
                      : null,
                  border: Border.all(color: ColorCodes.blueColor, width: 1),
                  borderRadius: BorderRadius.circular(10),
                ),
                child: Text(
                  answers!.answers![queCount].options![i].name ?? "",
                  textAlign: TextAlign.center,
                ),
              ),
            ),
          );
        },
      ),
    );

How can i apply effect for all question answers?

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