Home > Enterprise >  Updating a list of actions just before user clicking
Updating a list of actions just before user clicking

Time:08-07

I have a list of actions in a listview and updating every 5 seconds. User can click one of the actions. The problem is, sometimes listview could be updated just before the user click. Thus causing the user to click on a different item they want to click. What should I do in that case? Measure the pased time between listview update and user click, if it is too short then cancel the click. What would your solution be in this situation?

CodePudding user response:

Your solution is valid, you can reassign a DateTime.now() when there's an update and check the difference in the onTap(). Or you can replace the ListView with a CircularProgressIndicator while updating. If the update is sub-second, you can add an await Future.delayed(Duration()).

  • Related