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(
|
Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
@@ -156,6 +145,10 @@ class _MapContent extends StatelessWidget {
|
|||||||
traits: availableTraits,
|
traits: availableTraits,
|
||||||
selectedTrait: state.selectedTrait,
|
selectedTrait: state.selectedTrait,
|
||||||
traitCounts: traitCounts,
|
traitCounts: traitCounts,
|
||||||
|
onAddReview: () => _openAddFlow(
|
||||||
|
context,
|
||||||
|
userCoordinate ?? selected?.coordinate,
|
||||||
|
),
|
||||||
onVoice: placeCubit.recommendPlacesByVoice,
|
onVoice: placeCubit.recommendPlacesByVoice,
|
||||||
onClear: hasVoiceRecommendation
|
onClear: hasVoiceRecommendation
|
||||||
? () => unawaited(placeCubit.clearVoiceFilter())
|
? () => 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 {
|
class _RecommendationControls extends StatelessWidget {
|
||||||
const _RecommendationControls({
|
const _RecommendationControls({
|
||||||
required this.active,
|
required this.active,
|
||||||
required this.traits,
|
required this.traits,
|
||||||
required this.selectedTrait,
|
required this.selectedTrait,
|
||||||
required this.traitCounts,
|
required this.traitCounts,
|
||||||
|
required this.onAddReview,
|
||||||
required this.onVoice,
|
required this.onVoice,
|
||||||
required this.onClear,
|
required this.onClear,
|
||||||
});
|
});
|
||||||
@@ -349,6 +315,7 @@ class _RecommendationControls extends StatelessWidget {
|
|||||||
final List<PlaceTrait> traits;
|
final List<PlaceTrait> traits;
|
||||||
final PlaceTrait? selectedTrait;
|
final PlaceTrait? selectedTrait;
|
||||||
final Map<PlaceTrait, int> traitCounts;
|
final Map<PlaceTrait, int> traitCounts;
|
||||||
|
final VoidCallback onAddReview;
|
||||||
final Future<void> Function({
|
final Future<void> Function({
|
||||||
required String audioContentBase64,
|
required String audioContentBase64,
|
||||||
required String audioMimeType,
|
required String audioMimeType,
|
||||||
@@ -370,6 +337,12 @@ class _RecommendationControls extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
IconButton.filled(
|
||||||
|
onPressed: onAddReview,
|
||||||
|
icon: const Icon(Icons.add_location_alt_outlined),
|
||||||
|
tooltip: 'Добавить отзыв',
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: FilledButton.icon(
|
child: FilledButton.icon(
|
||||||
onPressed: () => _openVoice(context),
|
onPressed: () => _openVoice(context),
|
||||||
|
|||||||
Reference in New Issue
Block a user