Require Google place for voice reviews
All checks were successful
Build and deploy Flutter Web / build (push) Successful in 1m49s

This commit is contained in:
Ruslan Bakiev
2026-05-09 14:18:07 +07:00
parent b819b51c1f
commit f5f59d3020
4 changed files with 8 additions and 10 deletions

View File

@@ -161,23 +161,18 @@ class PlaceController extends AsyncNotifier<PlaceState> {
);
}
Future<void> publishReview({LatLng? coordinate}) async {
Future<void> publishReview({required PlaceRecommendation place}) async {
final value = state.requireValue;
if (!value.hasTelegramAuth) {
throw StateError('Открой через Telegram, чтобы оставить голос.');
}
final draft = value.reviewDraft;
final placeName = draft.placeName.trim().isEmpty
? 'Место на карте'
: draft.placeName.trim();
final point =
coordinate ?? value.userCoordinate ?? const LatLng(10.7729, 106.7004);
await _api.createVoiceExperience(
googlePlaceId: 'manual-${point.latitude}-${point.longitude}-$placeName',
googleName: placeName,
coordinate: point,
googlePlaceId: place.googlePlaceId,
googleName: place.name,
coordinate: place.coordinate,
durationSeconds: draft.duration.inSeconds,
audioObjectKey: 'web-recording-${DateTime.now().microsecondsSinceEpoch}',
);