An advanced, complete story viewer for Flutter. Has support for images, videos, custom widget contents, gestures, interceptors, listeners, manipulators and much more.
While calling an api call inside a iconButton callback in footer 2 things happens:
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.
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
Describe the bug
While calling an api call inside a iconButton callback in footer 2 things happens:
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();
Expected behavior to freeze the progress indicator while calling API and resume after completing the API
versions