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

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