mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Fix bug with missing year and add date to drag handle (#761)
This commit is contained in:
@@ -189,6 +189,7 @@ class ScrollLabel extends StatelessWidget {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16.0)),
|
||||
child: Container(
|
||||
constraints: constraints ?? _defaultConstraints,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
alignment: Alignment.center,
|
||||
child: child,
|
||||
),
|
||||
@@ -257,8 +258,6 @@ class DraggableScrollbarState extends State<DraggableScrollbar>
|
||||
Widget build(BuildContext context) {
|
||||
Text? labelText;
|
||||
if (widget.labelTextBuilder != null && _isDragInProcess) {
|
||||
int numberOfItems = widget.child.itemCount;
|
||||
|
||||
labelText = widget.labelTextBuilder!(_currentItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,8 +127,8 @@ class ImmichAssetGrid extends HookConsumerWidget {
|
||||
}
|
||||
|
||||
Text _labelBuilder(int pos) {
|
||||
return Text(
|
||||
"${renderList[pos].month} / ${renderList[pos].year}",
|
||||
final date = renderList[pos].date;
|
||||
return Text(DateFormat.yMMMd().format(date),
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -154,6 +154,7 @@ class ImmichAssetGrid extends HookConsumerWidget {
|
||||
controller: _itemScrollController,
|
||||
backgroundColor: Theme.of(context).hintColor,
|
||||
labelTextBuilder: _labelBuilder,
|
||||
labelConstraints: const BoxConstraints(maxHeight: 28),
|
||||
scrollbarAnimationDuration: const Duration(seconds: 1),
|
||||
scrollbarTimeToFade: const Duration(seconds: 4),
|
||||
child: ScrollablePositionedList.builder(
|
||||
|
||||
Reference in New Issue
Block a user