From dedde2deea6666e3428df6e19e3bd64b0723207e Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Sat, 13 Jun 2026 00:37:50 +0700 Subject: [PATCH] Move add review action to bottom controls --- .../mapflow/presentation/mapflow_shell.dart | 51 +++++-------------- 1 file changed, 12 insertions(+), 39 deletions(-) diff --git a/lib/features/mapflow/presentation/mapflow_shell.dart b/lib/features/mapflow/presentation/mapflow_shell.dart index 403a05c..bef6f0f 100644 --- a/lib/features/mapflow/presentation/mapflow_shell.dart +++ b/lib/features/mapflow/presentation/mapflow_shell.dart @@ -127,17 +127,6 @@ class _MapContent extends StatelessWidget { ), ), ), - SafeArea( - child: Align( - alignment: Alignment.topRight, - child: _AddReviewButton( - onPressed: () => _openAddFlow( - context, - userCoordinate ?? selected?.coordinate, - ), - ), - ), - ), Align( alignment: Alignment.bottomCenter, child: SafeArea( @@ -156,6 +145,10 @@ class _MapContent extends StatelessWidget { traits: availableTraits, selectedTrait: state.selectedTrait, traitCounts: traitCounts, + onAddReview: () => _openAddFlow( + context, + userCoordinate ?? selected?.coordinate, + ), onVoice: placeCubit.recommendPlacesByVoice, onClear: hasVoiceRecommendation ? () => unawaited(placeCubit.clearVoiceFilter()) @@ -307,40 +300,13 @@ class _UserAvatar extends StatelessWidget { } } -class _AddReviewButton extends StatelessWidget { - const _AddReviewButton({required this.onPressed}); - - final VoidCallback onPressed; - - @override - Widget build(BuildContext context) { - final tokens = context.mapflowTokens; - final colorScheme = Theme.of(context).colorScheme; - - return Padding( - padding: const EdgeInsets.only(top: 62, right: 12), - child: SizedBox.square( - dimension: 52, - child: IconButton.filled( - onPressed: onPressed, - icon: const Icon(Icons.add_location_alt_outlined), - style: FilledButton.styleFrom( - backgroundColor: tokens.mapPanel, - foregroundColor: colorScheme.onSurface, - ), - tooltip: 'Добавить отзыв', - ), - ), - ); - } -} - class _RecommendationControls extends StatelessWidget { const _RecommendationControls({ required this.active, required this.traits, required this.selectedTrait, required this.traitCounts, + required this.onAddReview, required this.onVoice, required this.onClear, }); @@ -349,6 +315,7 @@ class _RecommendationControls extends StatelessWidget { final List traits; final PlaceTrait? selectedTrait; final Map traitCounts; + final VoidCallback onAddReview; final Future Function({ required String audioContentBase64, required String audioMimeType, @@ -370,6 +337,12 @@ class _RecommendationControls extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ + IconButton.filled( + onPressed: onAddReview, + icon: const Icon(Icons.add_location_alt_outlined), + tooltip: 'Добавить отзыв', + ), + const SizedBox(width: 8), Expanded( child: FilledButton.icon( onPressed: () => _openVoice(context),