Fix add review route and photo previews
Build and deploy Flutter Web / build (push) Successful in 2m21s
Build and deploy Flutter Web / build (push) Successful in 2m21s
This commit is contained in:
@@ -320,15 +320,18 @@ class _AddReviewButton extends StatelessWidget {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8, right: 12),
|
||||
child: IconButton.filled(
|
||||
onPressed: onPressed,
|
||||
icon: const Icon(Icons.add_location_alt_outlined),
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: tokens.mapPanel,
|
||||
foregroundColor: colorScheme.onSurface,
|
||||
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: 'Добавить отзыв',
|
||||
),
|
||||
tooltip: 'Добавить отзыв',
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1043,8 +1046,7 @@ class _AddExperienceFlowState extends State<AddExperienceFlow> {
|
||||
final informationProgress = (_informationUnits / _minimumInformationUnits)
|
||||
.clamp(0.0, 1.0);
|
||||
final content = switch (_step) {
|
||||
0 => _IntroStep(onNext: () => setState(() => _step = 1)),
|
||||
1 => _VoiceStep(
|
||||
0 => _VoiceStep(
|
||||
placeName: '',
|
||||
promptHints: _voicePromptHints,
|
||||
hasTelegramAuth: widget.hasTelegramAuth,
|
||||
@@ -1061,11 +1063,11 @@ class _AddExperienceFlowState extends State<AddExperienceFlow> {
|
||||
}
|
||||
setState(() {
|
||||
_nearbyPlacesFuture = _loadNearbyPlaces();
|
||||
_step = 2;
|
||||
_step = 1;
|
||||
});
|
||||
},
|
||||
),
|
||||
_ => _PlaceStep(
|
||||
1 => _PlaceStep(
|
||||
placesFuture: _nearbyPlacesFuture,
|
||||
radiusMeters: _nearbyPlaceRadiusMeters,
|
||||
isSubmitting: _submitting,
|
||||
@@ -1073,12 +1075,13 @@ class _AddExperienceFlowState extends State<AddExperienceFlow> {
|
||||
controller.setReviewPlace(place.name);
|
||||
setState(() {
|
||||
_selectedPlaceForSubmit = place;
|
||||
_step = 3;
|
||||
_step = 2;
|
||||
});
|
||||
},
|
||||
),
|
||||
_ => const SizedBox.shrink(),
|
||||
};
|
||||
final contentWithFavoriteStep = _step == 3
|
||||
final contentWithFavoriteStep = _step == 2
|
||||
? _FavoriteStep(
|
||||
place: _selectedPlaceForSubmit,
|
||||
isSubmitting: _submitting,
|
||||
@@ -1100,7 +1103,7 @@ class _AddExperienceFlowState extends State<AddExperienceFlow> {
|
||||
children: [
|
||||
_StoryProgress(
|
||||
step: _step,
|
||||
total: 4,
|
||||
total: 3,
|
||||
dark: true,
|
||||
onClose: () => context.pop(),
|
||||
),
|
||||
@@ -1163,47 +1166,6 @@ class _AddExperienceFlowState extends State<AddExperienceFlow> {
|
||||
}
|
||||
}
|
||||
|
||||
class _IntroStep extends StatelessWidget {
|
||||
const _IntroStep({required this.onNext});
|
||||
|
||||
final VoidCallback onNext;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tokens = context.mapflowTokens;
|
||||
|
||||
return _StepLayout(
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 70,
|
||||
height: 70,
|
||||
decoration: BoxDecoration(
|
||||
color: tokens.danger,
|
||||
borderRadius: BorderRadius.circular(tokens.panelRadius),
|
||||
),
|
||||
child: Icon(Icons.graphic_eq, color: tokens.onDark, size: 38),
|
||||
),
|
||||
const SizedBox(height: 22),
|
||||
Text(
|
||||
'Поделись ощущением от места голосом. Нужно быть в заведении или не дальше 50 м. Аудио обработаем и удалим.',
|
||||
textAlign: TextAlign.left,
|
||||
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||
color: tokens.onDark,
|
||||
fontWeight: FontWeight.w800,
|
||||
height: 1.18,
|
||||
letterSpacing: 0,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
action: FilledButton(onPressed: onNext, child: const Text('Далее')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _PlaceStep extends StatelessWidget {
|
||||
const _PlaceStep({
|
||||
required this.placesFuture,
|
||||
@@ -1792,17 +1754,15 @@ class _VoiceRecordButtonState extends State<_VoiceRecordButton>
|
||||
}
|
||||
|
||||
class _StepLayout extends StatelessWidget {
|
||||
const _StepLayout({required this.body, this.action});
|
||||
const _StepLayout({required this.body});
|
||||
|
||||
final Widget body;
|
||||
final Widget? action;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(child: body),
|
||||
if (action != null) SizedBox(width: double.infinity, child: action),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user