fix(mobile): Empty albums don't show title (#3576)
This commit is contained in:
parent
60d39a7d1f
commit
5fa9704a65
1 changed files with 10 additions and 4 deletions
|
@ -248,8 +248,6 @@ class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
|
||||||
key: ValueKey(section.offset),
|
key: ValueKey(section.offset),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if (section.offset == 0 && widget.topWidget != null)
|
|
||||||
widget.topWidget!,
|
|
||||||
if (section.type == RenderAssetGridElementType.monthTitle)
|
if (section.type == RenderAssetGridElementType.monthTitle)
|
||||||
_buildMonthTitle(context, section.date),
|
_buildMonthTitle(context, section.date),
|
||||||
if (section.type == RenderAssetGridElementType.groupDividerTitle ||
|
if (section.type == RenderAssetGridElementType.groupDividerTitle ||
|
||||||
|
@ -289,7 +287,15 @@ class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _itemBuilder(BuildContext c, int position) {
|
Widget _itemBuilder(BuildContext c, int position) {
|
||||||
final item = widget.renderList.elements[position];
|
int index = position;
|
||||||
|
if (widget.topWidget != null) {
|
||||||
|
if (index == 0) {
|
||||||
|
return widget.topWidget!;
|
||||||
|
}
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
|
||||||
|
final item = widget.renderList.elements[index];
|
||||||
return _buildSection(c, item, _scrolling);
|
return _buildSection(c, item, _scrolling);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +335,7 @@ class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
|
||||||
itemBuilder: _itemBuilder,
|
itemBuilder: _itemBuilder,
|
||||||
itemPositionsListener: _itemPositionsListener,
|
itemPositionsListener: _itemPositionsListener,
|
||||||
itemScrollController: _itemScrollController,
|
itemScrollController: _itemScrollController,
|
||||||
itemCount: widget.renderList.elements.length,
|
itemCount: widget.renderList.elements.length + (widget.topWidget != null ? 1 : 0),
|
||||||
addRepaintBoundaries: true,
|
addRepaintBoundaries: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue