mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 11:24:37 +02:00
af32183728
* refactor: autoroutex pushroute * refactor: autoroutex popRoute * refactor: autoroutex navigate and replace * chore: add doc comments for extension methods * refactor: Add LoggerMixin and refactor Album activities to use mixin * refactor: Activity page * chore: activity user from user constructor * fix: update current asset after build method * refactor: tests with similar structure as lib * chore: remove avoid-declaring-call-method rule from dcm analysis * test: fix proper expect order * test: activity_statistics_provider_test * test: activity_provider_test * test: use proper matchers * test: activity_text_field_test & dismissible_activity_test added * test: add http mock to return transparent image * test: download isar core libs during test * test: add widget tags to widget test cases * test: activity_tile_test * build: currentAlbumProvider to generator * movie add / remove like to activity input tile * test: activities_page_test.dart * chore: better error logs * chore: dismissibleactivity as statelesswidget --------- Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
95 lines
3.9 KiB
Dart
95 lines
3.9 KiB
Dart
import 'package:auto_route/auto_route.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/modules/memories/providers/memory.provider.dart';
|
|
import 'package:immich_mobile/routing/router.dart';
|
|
import 'package:immich_mobile/shared/ui/immich_image.dart';
|
|
import 'package:openapi/api.dart';
|
|
|
|
class MemoryLane extends HookConsumerWidget {
|
|
const MemoryLane({super.key});
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final memoryLaneFutureProvider = ref.watch(memoryFutureProvider);
|
|
|
|
final memoryLane = memoryLaneFutureProvider
|
|
.whenData(
|
|
(memories) => memories != null
|
|
? Container(
|
|
margin: const EdgeInsets.only(top: 10, left: 10),
|
|
height: 200,
|
|
child: ListView.builder(
|
|
scrollDirection: Axis.horizontal,
|
|
shrinkWrap: true,
|
|
itemCount: memories.length,
|
|
itemBuilder: (context, index) {
|
|
final memory = memories[index];
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.only(right: 8.0, bottom: 8),
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
HapticFeedback.heavyImpact();
|
|
context.pushRoute(
|
|
MemoryRoute(
|
|
memories: memories,
|
|
memoryIndex: index,
|
|
),
|
|
);
|
|
},
|
|
child: Stack(
|
|
children: [
|
|
Card(
|
|
elevation: 3,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(13.0),
|
|
),
|
|
clipBehavior: Clip.hardEdge,
|
|
child: ColorFiltered(
|
|
colorFilter: ColorFilter.mode(
|
|
Colors.black.withOpacity(0.2),
|
|
BlendMode.darken,
|
|
),
|
|
child: ImmichImage(
|
|
memory.assets[0],
|
|
fit: BoxFit.cover,
|
|
width: 130,
|
|
height: 200,
|
|
useGrayBoxPlaceholder: true,
|
|
type: ThumbnailFormat.JPEG,
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 16,
|
|
left: 16,
|
|
child: ConstrainedBox(
|
|
constraints: const BoxConstraints(
|
|
maxWidth: 114,
|
|
),
|
|
child: Text(
|
|
memory.title,
|
|
style: const TextStyle(
|
|
fontWeight: FontWeight.w600,
|
|
color: Colors.white,
|
|
fontSize: 15,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
)
|
|
: const SizedBox(),
|
|
)
|
|
.value;
|
|
|
|
return memoryLane ?? const SizedBox();
|
|
}
|
|
}
|