Move add review action to bottom controls
Build and deploy Flutter Web / build (push) Successful in 2m48s
Build and deploy Flutter Web / build (push) Successful in 2m48s
This commit is contained in:
@@ -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<PlaceTrait> traits;
|
||||
final PlaceTrait? selectedTrait;
|
||||
final Map<PlaceTrait, int> traitCounts;
|
||||
final VoidCallback onAddReview;
|
||||
final Future<void> 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),
|
||||
|
||||
Reference in New Issue
Block a user