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

Minimum duration #19

Closed
FilipeOS opened this issue May 16, 2019 · 3 comments
Closed

Minimum duration #19

FilipeOS opened this issue May 16, 2019 · 3 comments
Labels
good first issue Good for newcomers waiting for response Issue addressed, response anticipated

Comments

@FilipeOS
Copy link

Hi there,

How can we add a minimum duration?
For example the spinner will always take 2 seconds at least?

@mmcc007
Copy link
Owner

mmcc007 commented May 18, 2019

Not sure why you would want to do this.

If you are expecting a 2 second delay (which is probably an unpleasant experience for the user), and the delay is beyond your control, then it seems the user just has to deal with it, if/when it comes-up. You might want to consider how you can reduce the delay.

Can you provide a use case where you need to show a minimum delay?

@FilipeOS
Copy link
Author

For example you are saving user settings and you want that user knows it's saving. Showing a loading for at least 1 or 2 seconds it's a must. Or user don't know it was saved sometimes

@mmcc007
Copy link
Owner

mmcc007 commented May 18, 2019

One simple way to add an artificial delay is to perhaps precede the actual delay with another call to wait for a future of a set duration to return before continuing. As in:

Future.delayed(Duration(seconds: 1), () {

@mmcc007 mmcc007 added the waiting for response Issue addressed, response anticipated label Jun 20, 2019
@mmcc007 mmcc007 added the good first issue Good for newcomers label Nov 15, 2019
@mmcc007 mmcc007 closed this as completed Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers waiting for response Issue addressed, response anticipated
Projects
None yet
Development

No branches or pull requests

2 participants