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

progress bar frozens while calling on api inside iconbuttom of footer #38

Open
surajpaudelNEPAL opened this issue Jul 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@surajpaudelNEPAL
Copy link

Describe the bug

While calling an api call inside a iconButton callback in footer 2 things happens:

  1. if I am not using async/await in iconButton callback with advcontroller.pause() before API call and advcontroller.resume() after API call frozen the progress bar but does not thorws any error and moves to next content without resuming the progressbar.
  2. if I am using async/await in iconbuttom callback with advcontroller.pause() before API call and advcontroller.resume() after API call it gives me following error for advcontroller.resume() : AssertionError
    ('package:flutter/src/animation/animation_controller.dart': Failed
    assertion: line 527 pos 7: '_ticker != null':
    AnimationController.animateTo() called after
    AnimationController.dispose()
    AnimationController methods should not be used after calling dispose.)

To Reproduce
Steps to reproduce the behavior:
here is my implementation of logic:
IconButton(
onPressed: () async {
storyController.pause();
await ref
.read(storyProvider
.notifier)
.likePostById(
postId:
currentStory
.id);
storyController
.resume();

                                                },
                                                icon: Icon(
                                                  Icons.favorite,)),

Expected behavior
to freeze the progress indicator while calling API and resume after completing the API

versions

  • Flutter 3.10.5
  • Dart 3.0.5
@ertgrulll ertgrulll added the bug Something isn't working label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants