|
@@ -1,10 +1,6 @@
|
|
|
-import 'dart:math';
|
|
|
-
|
|
|
import 'package:collection/collection.dart';
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
-import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
-import 'package:flutter/src/widgets/framework.dart';
|
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
import 'package:immich_mobile/modules/home/providers/home_page_render_list_provider.dart';
|
|
@@ -52,7 +48,9 @@ class ImmichAssetGrid extends HookConsumerWidget {
|
|
|
}
|
|
|
|
|
|
Widget _buildThumbnailOrPlaceholder(
|
|
|
- AssetResponseDto asset, bool placeholder) {
|
|
|
+ AssetResponseDto asset,
|
|
|
+ bool placeholder,
|
|
|
+ ) {
|
|
|
if (placeholder) {
|
|
|
return const DecoratedBox(
|
|
|
decoration: BoxDecoration(color: Colors.grey),
|
|
@@ -67,7 +65,10 @@ class ImmichAssetGrid extends HookConsumerWidget {
|
|
|
}
|
|
|
|
|
|
Widget _buildAssetRow(
|
|
|
- BuildContext context, RenderAssetGridRow row, bool scrolling) {
|
|
|
+ BuildContext context,
|
|
|
+ RenderAssetGridRow row,
|
|
|
+ bool scrolling,
|
|
|
+ ) {
|
|
|
double size = _getItemSize(context);
|
|
|
|
|
|
return Row(
|
|
@@ -87,7 +88,10 @@ class ImmichAssetGrid extends HookConsumerWidget {
|
|
|
}
|
|
|
|
|
|
Widget _buildTitle(
|
|
|
- BuildContext context, String title, List<AssetResponseDto> assets) {
|
|
|
+ BuildContext context,
|
|
|
+ String title,
|
|
|
+ List<AssetResponseDto> assets,
|
|
|
+ ) {
|
|
|
return DailyTitleText(
|
|
|
isoDate: title,
|
|
|
assetGroup: assets,
|
|
@@ -128,7 +132,8 @@ class ImmichAssetGrid extends HookConsumerWidget {
|
|
|
|
|
|
Text _labelBuilder(int pos) {
|
|
|
final date = renderList[pos].date;
|
|
|
- return Text(DateFormat.yMMMd().format(date),
|
|
|
+ return Text(
|
|
|
+ DateFormat.yMMMd().format(date),
|
|
|
style: const TextStyle(
|
|
|
color: Colors.white,
|
|
|
fontWeight: FontWeight.bold,
|
|
@@ -149,19 +154,20 @@ class ImmichAssetGrid extends HookConsumerWidget {
|
|
|
}
|
|
|
|
|
|
return DraggableScrollbar.semicircle(
|
|
|
- scrollStateListener: dragScrolling,
|
|
|
+ scrollStateListener: dragScrolling,
|
|
|
+ itemPositionsListener: _itemPositionsListener,
|
|
|
+ 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(
|
|
|
+ itemBuilder: itemBuilder,
|
|
|
itemPositionsListener: _itemPositionsListener,
|
|
|
- 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(
|
|
|
- itemBuilder: itemBuilder,
|
|
|
- itemPositionsListener: _itemPositionsListener,
|
|
|
- itemScrollController: _itemScrollController,
|
|
|
- itemCount: renderList.length,
|
|
|
- ));
|
|
|
+ itemScrollController: _itemScrollController,
|
|
|
+ itemCount: renderList.length,
|
|
|
+ ),
|
|
|
+ );
|
|
|
}
|
|
|
}
|