1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-04-21 15:36:26 +02:00

feat(mobile): Made Map Bottom Sheet extendable higher ()

Made Map Bottom Sheet extendable higher
This commit is contained in:
Yaros 2025-02-12 15:56:50 +01:00 committed by GitHub
parent 703361da1a
commit 7c821dd205
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,9 +59,10 @@ class MapBottomSheet extends HookConsumerWidget {
child: DraggableScrollableSheet(
controller: sheetController,
minChildSize: sheetMinExtent,
maxChildSize: 0.5,
maxChildSize: 0.8,
initialChildSize: sheetMinExtent,
snap: true,
snapSizes: [sheetMinExtent, 0.5, 0.8],
shouldCloseOnMinExtent: false,
builder: (ctx, scrollController) => MapAssetGrid(
controller: scrollController,
@ -78,18 +79,23 @@ class MapBottomSheet extends HookConsumerWidget {
),
ValueListenableBuilder(
valueListenable: bottomSheetOffset,
builder: (ctx, value, child) => Positioned(
right: 0,
bottom: context.height * (value + 0.02),
child: child!,
),
child: ElevatedButton(
onPressed: onZoomToLocation,
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
),
child: const Icon(Icons.my_location),
),
builder: (context, value, child) {
return Positioned(
right: 0,
bottom: context.height * (value + 0.02),
child: AnimatedOpacity(
opacity: value < 0.8 ? 1 : 0,
duration: const Duration(milliseconds: 150),
child: ElevatedButton(
onPressed: onZoomToLocation,
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
),
child: const Icon(Icons.my_location),
),
),
);
},
),
],
);