Fix scrolling to last element
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
53dfe7327b
commit
96dbddb10c
|
@ -61,8 +61,16 @@ class _ListPageState extends State<ListPage> {
|
|||
if (i.isOdd) return Divider();
|
||||
|
||||
final index = i ~/ 2;
|
||||
|
||||
// This handles the case if there are no more elements in the list left which can be provided by the api
|
||||
if(VikunjaGlobal.of(context).taskService.maxPages == _currentPage && index == _tasks.length - 1) return null;
|
||||
|
||||
if (index >= _tasks.length && VikunjaGlobal.of(context).taskService.maxPages < _currentPage) {
|
||||
_currentPage++;
|
||||
// FIXME: This does not get loaded until some time after the next (_tasks.length + 1) entry should have been rendered
|
||||
// This leads to errors because the render method tries to access an entry of _tasks with an index which does not exist
|
||||
// The load function gets actually called after the return below. I assume this is because of the setState() invocation
|
||||
// in _loadTasksForPage()?
|
||||
_loadTasksForPage(_currentPage);
|
||||
}
|
||||
return TaskTile(
|
||||
|
|
Reference in New Issue