Require Google place for voice reviews
All checks were successful
Build and deploy Flutter Web / build (push) Successful in 1m49s
All checks were successful
Build and deploy Flutter Web / build (push) Successful in 1m49s
This commit is contained in:
@@ -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}',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user