Skip to content

Commit 46f6bbe

Browse files
committed
fix: replay button
重播時禁用使用圖層按鈕
1 parent f65fd80 commit 46f6bbe

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

lib/app/map/_widgets/ui/positioned_layer_button.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:material_symbols_icons/material_symbols_icons.dart';
99
class PositionedLayerButton extends StatelessWidget {
1010
final Set<MapLayer> activeLayers;
1111
final BaseMapType currentBaseMap;
12+
final bool isReplayMode;
1213
final void Function(MapLayer layer, bool show, Set<MapLayer> activeLayers)
1314
onLayerChanged;
1415
final void Function(BaseMapType baseMap) onBaseMapChanged;
@@ -17,18 +18,21 @@ class PositionedLayerButton extends StatelessWidget {
1718
super.key,
1819
required this.activeLayers,
1920
required this.currentBaseMap,
21+
required this.isReplayMode,
2022
required this.onLayerChanged,
2123
required this.onBaseMapChanged,
2224
});
2325

2426
@override
2527
Widget build(BuildContext context) {
28+
if (isReplayMode) return const SizedBox.shrink();
2629
return Positioned(
2730
top: 24,
2831
right: 24,
2932
child: SafeArea(
3033
child: BlurredIconButton(
3134
icon: const Icon(Symbols.layers_rounded),
35+
tooltip: '圖層',
3236
elevation: 2,
3337
onPressed: () => showModalBottomSheet(
3438
context: context,

lib/app/map/page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ class _MapPageState extends State<MapPage> with TickerProviderStateMixin {
343343
PositionedLayerButton(
344344
activeLayers: _activeLayers,
345345
currentBaseMap: _baseMapType,
346+
isReplayMode: widget.options?.replayTimestamp != null,
346347
onLayerChanged: toggleLayer,
347348
onBaseMapChanged: setBaseMapType,
348349
),

0 commit comments

Comments
 (0)