mirror of
https://github.com/immich-app/immich.git
synced 2025-03-01 15:11:21 +01:00
Adds padding and hero to memories
This commit is contained in:
parent
4fa55f0e0b
commit
b8edc7114e
1 changed files with 46 additions and 41 deletions
|
@ -16,41 +16,46 @@ class MemoryLane extends HookConsumerWidget {
|
||||||
final memoryLane = memoryLaneFutureProvider
|
final memoryLane = memoryLaneFutureProvider
|
||||||
.whenData(
|
.whenData(
|
||||||
(memories) => memories != null
|
(memories) => memories != null
|
||||||
? Container(
|
? SizedBox(
|
||||||
margin: const EdgeInsets.only(top: 10, left: 10),
|
|
||||||
height: 200,
|
height: 200,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: memories.length,
|
itemCount: memories.length,
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
right: 8.0,
|
||||||
|
bottom: 8,
|
||||||
|
top: 10,
|
||||||
|
left: 10,
|
||||||
|
),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final memory = memories[index];
|
final memory = memories[index];
|
||||||
|
|
||||||
return Padding(
|
return GestureDetector(
|
||||||
padding: const EdgeInsets.only(right: 8.0, bottom: 8),
|
onTap: () {
|
||||||
child: GestureDetector(
|
HapticFeedback.heavyImpact();
|
||||||
onTap: () {
|
context.pushRoute(
|
||||||
HapticFeedback.heavyImpact();
|
MemoryRoute(
|
||||||
context.pushRoute(
|
memories: memories,
|
||||||
MemoryRoute(
|
memoryIndex: index,
|
||||||
memories: memories,
|
),
|
||||||
memoryIndex: index,
|
);
|
||||||
|
},
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Card(
|
||||||
|
elevation: 3,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(13.0),
|
||||||
),
|
),
|
||||||
);
|
clipBehavior: Clip.hardEdge,
|
||||||
},
|
child: ColorFiltered(
|
||||||
child: Stack(
|
colorFilter: ColorFilter.mode(
|
||||||
children: [
|
Colors.black.withOpacity(0.2),
|
||||||
Card(
|
BlendMode.darken,
|
||||||
elevation: 3,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(13.0),
|
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.hardEdge,
|
child: Hero(
|
||||||
child: ColorFiltered(
|
tag: memory.assets[0].id,
|
||||||
colorFilter: ColorFilter.mode(
|
|
||||||
Colors.black.withOpacity(0.2),
|
|
||||||
BlendMode.darken,
|
|
||||||
),
|
|
||||||
child: ImmichImage(
|
child: ImmichImage(
|
||||||
memory.assets[0],
|
memory.assets[0],
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
@ -61,25 +66,25 @@ class MemoryLane extends HookConsumerWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
),
|
||||||
bottom: 16,
|
Positioned(
|
||||||
left: 16,
|
bottom: 16,
|
||||||
child: ConstrainedBox(
|
left: 16,
|
||||||
constraints: const BoxConstraints(
|
child: ConstrainedBox(
|
||||||
maxWidth: 114,
|
constraints: const BoxConstraints(
|
||||||
),
|
maxWidth: 114,
|
||||||
child: Text(
|
),
|
||||||
memory.title,
|
child: Text(
|
||||||
style: const TextStyle(
|
memory.title,
|
||||||
fontWeight: FontWeight.w600,
|
style: const TextStyle(
|
||||||
color: Colors.white,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 15,
|
color: Colors.white,
|
||||||
),
|
fontSize: 15,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue