Hide placeholder for maps plugin on desktop

This commit is contained in:
Shawn 2023-07-28 10:04:16 -06:00
parent 4492f9e4ee
commit d3e7e7e606

View File

@ -134,7 +134,7 @@ class _ScrollingContent extends StatelessWidget {
buildText(data.locationInfo2), buildText(data.locationInfo2),
]), ]),
Gap($styles.insets.md), Gap($styles.insets.md),
AspectRatio(aspectRatio: 1.65, child: _MapsThumbnail(data)), _MapsThumbnail(data),
Gap($styles.insets.md), Gap($styles.insets.md),
..._contentSection([Center(child: buildHiddenCollectible(slot: 3))]), ..._contentSection([Center(child: buildHiddenCollectible(slot: 3))]),
Gap(150), Gap(150),
@ -228,45 +228,48 @@ class _MapsThumbnailState extends State<_MapsThumbnail> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
void handlePressed() => context.push(ScreenPaths.maps(widget.data.type)); void handlePressed() => context.push(ScreenPaths.maps(widget.data.type));
if (PlatformInfo.isDesktop) return Placeholder(); if (PlatformInfo.isDesktop) return SizedBox.shrink();
return MergeSemantics( return AspectRatio(
child: Column( aspectRatio: 1.65,
children: [ child: MergeSemantics(
Flexible( child: Column(
child: ClipRRect( children: [
borderRadius: BorderRadius.circular($styles.corners.md), Flexible(
child: AppBtn.basic( child: ClipRRect(
semanticLabel: $strings.scrollingContentSemanticOpen, borderRadius: BorderRadius.circular($styles.corners.md),
onPressed: handlePressed, child: AppBtn.basic(
semanticLabel: $strings.scrollingContentSemanticOpen,
onPressed: handlePressed,
/// To prevent the map widget from absorbing the onPressed action, use a Stack + IgnorePointer + a transparent Container /// To prevent the map widget from absorbing the onPressed action, use a Stack + IgnorePointer + a transparent Container
child: Stack( child: Stack(
children: [ children: [
Positioned.fill(child: ColoredBox(color: Colors.transparent)), Positioned.fill(child: ColoredBox(color: Colors.transparent)),
IgnorePointer( IgnorePointer(
child: GoogleMap( child: GoogleMap(
markers: {getMapsMarker(startPos.target)}, markers: {getMapsMarker(startPos.target)},
zoomControlsEnabled: false, zoomControlsEnabled: false,
mapType: MapType.normal, mapType: MapType.normal,
mapToolbarEnabled: false, mapToolbarEnabled: false,
initialCameraPosition: startPos, initialCameraPosition: startPos,
myLocationButtonEnabled: false, myLocationButtonEnabled: false,
),
), ),
), ],
], ),
), ),
), ),
), ),
), Gap($styles.insets.xs),
Gap($styles.insets.xs), Semantics(
Semantics( sortKey: OrdinalSortKey(0),
sortKey: OrdinalSortKey(0), child: Padding(
child: Padding( padding: EdgeInsets.symmetric(horizontal: $styles.insets.md),
padding: EdgeInsets.symmetric(horizontal: $styles.insets.md), child: Text(widget.data.mapCaption, style: $styles.text.caption),
child: Text(widget.data.mapCaption, style: $styles.text.caption), ),
), ),
), ],
], ),
), ),
); );
} }