mirror of
https://github.com/immich-app/immich.git
synced 2025-01-21 00:52:43 -05:00
fix(mobile): invalid range on label builder crash timeline (#3759)
* fix(mobile): invalid date on label builder crash timeline * actual fix --------- Co-authored-by: Alex Tran <Alex.Tran@conductix.com>
This commit is contained in:
parent
2de30e34f4
commit
28d3d3e679
1 changed files with 9 additions and 2 deletions
|
@ -300,7 +300,13 @@ class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Text _labelBuilder(int pos) {
|
Text _labelBuilder(int pos) {
|
||||||
final date = widget.renderList.elements[pos].date;
|
final maxLength = widget.renderList.elements.length;
|
||||||
|
if (pos < 0 || pos >= maxLength) {
|
||||||
|
return const Text("");
|
||||||
|
}
|
||||||
|
|
||||||
|
final date = widget.renderList.elements[pos % maxLength].date;
|
||||||
|
|
||||||
return Text(
|
return Text(
|
||||||
DateFormat.yMMMM().format(date),
|
DateFormat.yMMMM().format(date),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
|
@ -335,7 +341,8 @@ class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
|
||||||
itemBuilder: _itemBuilder,
|
itemBuilder: _itemBuilder,
|
||||||
itemPositionsListener: _itemPositionsListener,
|
itemPositionsListener: _itemPositionsListener,
|
||||||
itemScrollController: _itemScrollController,
|
itemScrollController: _itemScrollController,
|
||||||
itemCount: widget.renderList.elements.length + (widget.topWidget != null ? 1 : 0),
|
itemCount: widget.renderList.elements.length +
|
||||||
|
(widget.topWidget != null ? 1 : 0),
|
||||||
addRepaintBoundaries: true,
|
addRepaintBoundaries: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue