Replace chat search with voice filter recommendations
Build and deploy Flutter Web / build (push) Successful in 3m11s
Build and deploy Flutter Web / build (push) Successful in 3m11s
This commit is contained in:
+1
-1
Submodule graphql-contracts updated: 39f32e3d36...d694c7d78c
@@ -20,8 +20,8 @@ class PlaceState {
|
||||
required this.hasTelegramAuth,
|
||||
required this.userCoordinate,
|
||||
required this.reviewDraft,
|
||||
required this.searchQuery,
|
||||
required this.searchMessage,
|
||||
required this.voiceFilterTranscript,
|
||||
required this.voiceFilterTags,
|
||||
});
|
||||
|
||||
static final _distance = Distance();
|
||||
@@ -33,8 +33,8 @@ class PlaceState {
|
||||
final bool hasTelegramAuth;
|
||||
final LatLng? userCoordinate;
|
||||
final VoiceReviewDraft reviewDraft;
|
||||
final String searchQuery;
|
||||
final String searchMessage;
|
||||
final String voiceFilterTranscript;
|
||||
final List<String> voiceFilterTags;
|
||||
|
||||
List<PlaceRecommendation> get recommendations {
|
||||
final selected = selectedTrait;
|
||||
@@ -74,8 +74,8 @@ class PlaceState {
|
||||
bool? hasTelegramAuth,
|
||||
Object? userCoordinate = _unset,
|
||||
VoiceReviewDraft? reviewDraft,
|
||||
String? searchQuery,
|
||||
String? searchMessage,
|
||||
String? voiceFilterTranscript,
|
||||
List<String>? voiceFilterTags,
|
||||
}) {
|
||||
return PlaceState(
|
||||
selectedTrait: identical(selectedTrait, _unset)
|
||||
@@ -93,8 +93,9 @@ class PlaceState {
|
||||
? this.userCoordinate
|
||||
: userCoordinate as LatLng?,
|
||||
reviewDraft: reviewDraft ?? this.reviewDraft,
|
||||
searchQuery: searchQuery ?? this.searchQuery,
|
||||
searchMessage: searchMessage ?? this.searchMessage,
|
||||
voiceFilterTranscript:
|
||||
voiceFilterTranscript ?? this.voiceFilterTranscript,
|
||||
voiceFilterTags: voiceFilterTags ?? this.voiceFilterTags,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -164,8 +165,8 @@ class PlaceCubit extends Cubit<PlaceViewState> {
|
||||
hasTelegramAuth: _authRepository.hasTelegramAuth,
|
||||
userCoordinate: userCoordinate,
|
||||
reviewDraft: _emptyDraft,
|
||||
searchQuery: '',
|
||||
searchMessage: '',
|
||||
voiceFilterTranscript: '',
|
||||
voiceFilterTags: const [],
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -182,7 +183,12 @@ class PlaceCubit extends Cubit<PlaceViewState> {
|
||||
}
|
||||
emit(
|
||||
PlaceViewState.ready(
|
||||
value.copyWith(selectedTrait: trait, selectedPlaceId: next?.id),
|
||||
value.copyWith(
|
||||
selectedTrait: trait,
|
||||
selectedPlaceId: next?.id,
|
||||
voiceFilterTranscript: '',
|
||||
voiceFilterTags: const [],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -202,15 +208,15 @@ class PlaceCubit extends Cubit<PlaceViewState> {
|
||||
emit(PlaceViewState.ready(value.copyWith(selectedPlaceId: placeId)));
|
||||
}
|
||||
|
||||
Future<void> searchPlaces(String query) async {
|
||||
Future<void> recommendPlacesByVoice({
|
||||
required String audioContentBase64,
|
||||
required String audioMimeType,
|
||||
}) async {
|
||||
final value = _requireReady();
|
||||
final normalizedQuery = query.trim();
|
||||
if (normalizedQuery.isEmpty) {
|
||||
await clearSearch();
|
||||
return;
|
||||
}
|
||||
|
||||
final result = await _placesRepository.searchPlaces(normalizedQuery);
|
||||
final result = await _placesRepository.recommendPlacesByVoice(
|
||||
audioContentBase64: audioContentBase64,
|
||||
audioMimeType: audioMimeType,
|
||||
);
|
||||
emit(
|
||||
PlaceViewState.ready(
|
||||
value.copyWith(
|
||||
@@ -219,14 +225,14 @@ class PlaceCubit extends Cubit<PlaceViewState> {
|
||||
? null
|
||||
: result.places.first.id,
|
||||
selectedTrait: null,
|
||||
searchQuery: normalizedQuery,
|
||||
searchMessage: result.message,
|
||||
voiceFilterTranscript: result.transcript,
|
||||
voiceFilterTags: result.tags,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> clearSearch() async {
|
||||
Future<void> clearVoiceFilter() async {
|
||||
final value = _requireReady();
|
||||
final places = await _placesRepository.fetchPlaces();
|
||||
emit(
|
||||
@@ -235,8 +241,8 @@ class PlaceCubit extends Cubit<PlaceViewState> {
|
||||
places: places,
|
||||
selectedPlaceId: places.isEmpty ? null : places.first.id,
|
||||
selectedTrait: null,
|
||||
searchQuery: '',
|
||||
searchMessage: '',
|
||||
voiceFilterTranscript: '',
|
||||
voiceFilterTags: const [],
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -310,8 +316,8 @@ class PlaceCubit extends Cubit<PlaceViewState> {
|
||||
places: places,
|
||||
selectedPlaceId: selectedPlace,
|
||||
reviewDraft: _emptyDraft,
|
||||
searchQuery: '',
|
||||
searchMessage: '',
|
||||
voiceFilterTranscript: '',
|
||||
voiceFilterTags: const [],
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -342,8 +348,8 @@ class PlaceCubit extends Cubit<PlaceViewState> {
|
||||
hasTelegramAuth: hasTelegramAuth,
|
||||
userCoordinate: null,
|
||||
reviewDraft: _emptyDraft,
|
||||
searchQuery: '',
|
||||
searchMessage: '',
|
||||
voiceFilterTranscript: '',
|
||||
voiceFilterTags: const [],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+21
-7
@@ -4,14 +4,14 @@
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:gql/ast.dart' as _i1;
|
||||
|
||||
const SearchPlaces = _i1.OperationDefinitionNode(
|
||||
type: _i1.OperationType.query,
|
||||
name: _i1.NameNode(value: 'SearchPlaces'),
|
||||
const RecommendPlacesByVoice = _i1.OperationDefinitionNode(
|
||||
type: _i1.OperationType.mutation,
|
||||
name: _i1.NameNode(value: 'RecommendPlacesByVoice'),
|
||||
variableDefinitions: [
|
||||
_i1.VariableDefinitionNode(
|
||||
variable: _i1.VariableNode(name: _i1.NameNode(value: 'input')),
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'SearchPlacesInput'),
|
||||
name: _i1.NameNode(value: 'VoicePlaceRecommendationsInput'),
|
||||
isNonNull: true,
|
||||
),
|
||||
defaultValue: _i1.DefaultValueNode(value: null),
|
||||
@@ -22,7 +22,7 @@ const SearchPlaces = _i1.OperationDefinitionNode(
|
||||
selectionSet: _i1.SelectionSetNode(
|
||||
selections: [
|
||||
_i1.FieldNode(
|
||||
name: _i1.NameNode(value: 'searchPlaces'),
|
||||
name: _i1.NameNode(value: 'recommendPlacesByVoice'),
|
||||
alias: null,
|
||||
arguments: [
|
||||
_i1.ArgumentNode(
|
||||
@@ -34,7 +34,21 @@ const SearchPlaces = _i1.OperationDefinitionNode(
|
||||
selectionSet: _i1.SelectionSetNode(
|
||||
selections: [
|
||||
_i1.FieldNode(
|
||||
name: _i1.NameNode(value: 'message'),
|
||||
name: _i1.NameNode(value: 'transcript'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
_i1.FieldNode(
|
||||
name: _i1.NameNode(value: 'tags'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
_i1.FieldNode(
|
||||
name: _i1.NameNode(value: 'summary'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
@@ -192,4 +206,4 @@ const SearchPlaces = _i1.OperationDefinitionNode(
|
||||
],
|
||||
),
|
||||
);
|
||||
const document = _i1.DocumentNode(definitions: [SearchPlaces]);
|
||||
const document = _i1.DocumentNode(definitions: [RecommendPlacesByVoice]);
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/json_object.dart' as _i2;
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/schema.schema.gql.dart'
|
||||
as _i3;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/serializers.gql.dart'
|
||||
as _i1;
|
||||
|
||||
part 'recommend_places_by_voice.data.gql.g.dart';
|
||||
|
||||
abstract class GRecommendPlacesByVoiceData
|
||||
implements
|
||||
Built<GRecommendPlacesByVoiceData, GRecommendPlacesByVoiceDataBuilder> {
|
||||
GRecommendPlacesByVoiceData._();
|
||||
|
||||
factory GRecommendPlacesByVoiceData([
|
||||
void Function(GRecommendPlacesByVoiceDataBuilder b) updates,
|
||||
]) = _$GRecommendPlacesByVoiceData;
|
||||
|
||||
static void _initializeBuilder(GRecommendPlacesByVoiceDataBuilder b) =>
|
||||
b..G__typename = 'Mutation';
|
||||
|
||||
@BuiltValueField(wireName: '__typename')
|
||||
String get G__typename;
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice get recommendPlacesByVoice;
|
||||
static Serializer<GRecommendPlacesByVoiceData> get serializer =>
|
||||
_$gRecommendPlacesByVoiceDataSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i1.serializers.serializeWith(
|
||||
GRecommendPlacesByVoiceData.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GRecommendPlacesByVoiceData? fromJson(Map<String, dynamic> json) => _i1
|
||||
.serializers
|
||||
.deserializeWith(GRecommendPlacesByVoiceData.serializer, json);
|
||||
}
|
||||
|
||||
abstract class GRecommendPlacesByVoiceData_recommendPlacesByVoice
|
||||
implements
|
||||
Built<
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoiceBuilder
|
||||
> {
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice._();
|
||||
|
||||
factory GRecommendPlacesByVoiceData_recommendPlacesByVoice([
|
||||
void Function(GRecommendPlacesByVoiceData_recommendPlacesByVoiceBuilder b)
|
||||
updates,
|
||||
]) = _$GRecommendPlacesByVoiceData_recommendPlacesByVoice;
|
||||
|
||||
static void _initializeBuilder(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoiceBuilder b,
|
||||
) => b..G__typename = 'VoicePlaceRecommendationsPayload';
|
||||
|
||||
@BuiltValueField(wireName: '__typename')
|
||||
String get G__typename;
|
||||
String get transcript;
|
||||
BuiltList<String> get tags;
|
||||
String get summary;
|
||||
BuiltList<GRecommendPlacesByVoiceData_recommendPlacesByVoice_places>
|
||||
get places;
|
||||
static Serializer<GRecommendPlacesByVoiceData_recommendPlacesByVoice>
|
||||
get serializer =>
|
||||
_$gRecommendPlacesByVoiceDataRecommendPlacesByVoiceSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i1.serializers.serializeWith(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GRecommendPlacesByVoiceData_recommendPlacesByVoice? fromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _i1.serializers.deserializeWith(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice.serializer,
|
||||
json,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class GRecommendPlacesByVoiceData_recommendPlacesByVoice_places
|
||||
implements
|
||||
Built<
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_placesBuilder
|
||||
> {
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places._();
|
||||
|
||||
factory GRecommendPlacesByVoiceData_recommendPlacesByVoice_places([
|
||||
void Function(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_placesBuilder b,
|
||||
)
|
||||
updates,
|
||||
]) = _$GRecommendPlacesByVoiceData_recommendPlacesByVoice_places;
|
||||
|
||||
static void _initializeBuilder(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_placesBuilder b,
|
||||
) => b..G__typename = 'Place';
|
||||
|
||||
@BuiltValueField(wireName: '__typename')
|
||||
String get G__typename;
|
||||
String get id;
|
||||
String get googlePlaceId;
|
||||
String get name;
|
||||
double get latitude;
|
||||
double get longitude;
|
||||
String? get googlePrimaryType;
|
||||
BuiltList<String> get googleTypes;
|
||||
String? get googleBusinessStatus;
|
||||
double? get googleRating;
|
||||
int? get googleUserRatingCount;
|
||||
_i2.JsonObject? get googleRegularOpeningHours;
|
||||
_i2.JsonObject? get googleCurrentOpeningHours;
|
||||
BuiltList<String> get photoUrls;
|
||||
BuiltList<String> get traits;
|
||||
bool get isFavorite;
|
||||
BuiltList<
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences
|
||||
>
|
||||
get experiences;
|
||||
static Serializer<GRecommendPlacesByVoiceData_recommendPlacesByVoice_places>
|
||||
get serializer =>
|
||||
_$gRecommendPlacesByVoiceDataRecommendPlacesByVoicePlacesSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i1.serializers.serializeWith(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places
|
||||
.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GRecommendPlacesByVoiceData_recommendPlacesByVoice_places? fromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _i1.serializers.deserializeWith(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places.serializer,
|
||||
json,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences
|
||||
implements
|
||||
Built<
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiencesBuilder
|
||||
> {
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences._();
|
||||
|
||||
factory GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences([
|
||||
void Function(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiencesBuilder
|
||||
b,
|
||||
)
|
||||
updates,
|
||||
]) = _$GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences;
|
||||
|
||||
static void _initializeBuilder(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiencesBuilder
|
||||
b,
|
||||
) => b..G__typename = 'VoiceExperience';
|
||||
|
||||
@BuiltValueField(wireName: '__typename')
|
||||
String get G__typename;
|
||||
String get id;
|
||||
_i3.GVoiceExperienceStatus get status;
|
||||
String get createdAt;
|
||||
static Serializer<
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences
|
||||
>
|
||||
get serializer =>
|
||||
_$gRecommendPlacesByVoiceDataRecommendPlacesByVoicePlacesExperiencesSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i1.serializers.serializeWith(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences
|
||||
.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences?
|
||||
fromJson(Map<String, dynamic> json) => _i1.serializers.deserializeWith(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences
|
||||
.serializer,
|
||||
json,
|
||||
);
|
||||
}
|
||||
+379
-212
File diff suppressed because it is too large
Load Diff
+38
-26
@@ -6,35 +6,39 @@ import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:ferry_exec/ferry_exec.dart' as _i1;
|
||||
import 'package:gql_exec/gql_exec.dart' as _i4;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/search_places.ast.gql.dart'
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/recommend_places_by_voice.ast.gql.dart'
|
||||
as _i5;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/search_places.data.gql.dart'
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/recommend_places_by_voice.data.gql.dart'
|
||||
as _i2;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/search_places.var.gql.dart'
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/recommend_places_by_voice.var.gql.dart'
|
||||
as _i3;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/serializers.gql.dart'
|
||||
as _i6;
|
||||
|
||||
part 'search_places.req.gql.g.dart';
|
||||
part 'recommend_places_by_voice.req.gql.g.dart';
|
||||
|
||||
abstract class GSearchPlacesReq
|
||||
abstract class GRecommendPlacesByVoiceReq
|
||||
implements
|
||||
Built<GSearchPlacesReq, GSearchPlacesReqBuilder>,
|
||||
_i1.OperationRequest<_i2.GSearchPlacesData, _i3.GSearchPlacesVars> {
|
||||
GSearchPlacesReq._();
|
||||
Built<GRecommendPlacesByVoiceReq, GRecommendPlacesByVoiceReqBuilder>,
|
||||
_i1.OperationRequest<
|
||||
_i2.GRecommendPlacesByVoiceData,
|
||||
_i3.GRecommendPlacesByVoiceVars
|
||||
> {
|
||||
GRecommendPlacesByVoiceReq._();
|
||||
|
||||
factory GSearchPlacesReq([void Function(GSearchPlacesReqBuilder b) updates]) =
|
||||
_$GSearchPlacesReq;
|
||||
factory GRecommendPlacesByVoiceReq([
|
||||
void Function(GRecommendPlacesByVoiceReqBuilder b) updates,
|
||||
]) = _$GRecommendPlacesByVoiceReq;
|
||||
|
||||
static void _initializeBuilder(GSearchPlacesReqBuilder b) => b
|
||||
static void _initializeBuilder(GRecommendPlacesByVoiceReqBuilder b) => b
|
||||
..operation = _i4.Operation(
|
||||
document: _i5.document,
|
||||
operationName: 'SearchPlaces',
|
||||
operationName: 'RecommendPlacesByVoice',
|
||||
)
|
||||
..executeOnListen = true;
|
||||
|
||||
@override
|
||||
_i3.GSearchPlacesVars get vars;
|
||||
_i3.GRecommendPlacesByVoiceVars get vars;
|
||||
@override
|
||||
_i4.Operation get operation;
|
||||
@override
|
||||
@@ -48,13 +52,13 @@ abstract class GSearchPlacesReq
|
||||
String? get requestId;
|
||||
@override
|
||||
@BuiltValueField(serialize: false)
|
||||
_i2.GSearchPlacesData? Function(
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GRecommendPlacesByVoiceData? Function(
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
)?
|
||||
get updateResult;
|
||||
@override
|
||||
_i2.GSearchPlacesData? get optimisticResponse;
|
||||
_i2.GRecommendPlacesByVoiceData? get optimisticResponse;
|
||||
@override
|
||||
String? get updateCacheHandlerKey;
|
||||
@override
|
||||
@@ -67,27 +71,35 @@ abstract class GSearchPlacesReq
|
||||
@BuiltValueField(serialize: false)
|
||||
_i4.Context? get context;
|
||||
@override
|
||||
_i2.GSearchPlacesData? parseData(Map<String, dynamic> json) =>
|
||||
_i2.GSearchPlacesData.fromJson(json);
|
||||
_i2.GRecommendPlacesByVoiceData? parseData(Map<String, dynamic> json) =>
|
||||
_i2.GRecommendPlacesByVoiceData.fromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> varsToJson() => vars.toJson();
|
||||
|
||||
@override
|
||||
Map<String, dynamic> dataToJson(_i2.GSearchPlacesData data) => data.toJson();
|
||||
Map<String, dynamic> dataToJson(_i2.GRecommendPlacesByVoiceData data) =>
|
||||
data.toJson();
|
||||
|
||||
@override
|
||||
_i1.OperationRequest<_i2.GSearchPlacesData, _i3.GSearchPlacesVars>
|
||||
_i1.OperationRequest<
|
||||
_i2.GRecommendPlacesByVoiceData,
|
||||
_i3.GRecommendPlacesByVoiceVars
|
||||
>
|
||||
transformOperation(_i4.Operation Function(_i4.Operation) transform) =>
|
||||
this.rebuild((b) => b..operation = transform(operation));
|
||||
|
||||
static Serializer<GSearchPlacesReq> get serializer =>
|
||||
_$gSearchPlacesReqSerializer;
|
||||
static Serializer<GRecommendPlacesByVoiceReq> get serializer =>
|
||||
_$gRecommendPlacesByVoiceReqSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i6.serializers.serializeWith(GSearchPlacesReq.serializer, this)
|
||||
(_i6.serializers.serializeWith(
|
||||
GRecommendPlacesByVoiceReq.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GSearchPlacesReq? fromJson(Map<String, dynamic> json) =>
|
||||
_i6.serializers.deserializeWith(GSearchPlacesReq.serializer, json);
|
||||
static GRecommendPlacesByVoiceReq? fromJson(Map<String, dynamic> json) => _i6
|
||||
.serializers
|
||||
.deserializeWith(GRecommendPlacesByVoiceReq.serializer, json);
|
||||
}
|
||||
+76
-66
@@ -1,32 +1,35 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'search_places.req.gql.dart';
|
||||
part of 'recommend_places_by_voice.req.gql.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Serializer<GSearchPlacesReq> _$gSearchPlacesReqSerializer =
|
||||
_$GSearchPlacesReqSerializer();
|
||||
Serializer<GRecommendPlacesByVoiceReq> _$gRecommendPlacesByVoiceReqSerializer =
|
||||
_$GRecommendPlacesByVoiceReqSerializer();
|
||||
|
||||
class _$GSearchPlacesReqSerializer
|
||||
implements StructuredSerializer<GSearchPlacesReq> {
|
||||
class _$GRecommendPlacesByVoiceReqSerializer
|
||||
implements StructuredSerializer<GRecommendPlacesByVoiceReq> {
|
||||
@override
|
||||
final Iterable<Type> types = const [GSearchPlacesReq, _$GSearchPlacesReq];
|
||||
final Iterable<Type> types = const [
|
||||
GRecommendPlacesByVoiceReq,
|
||||
_$GRecommendPlacesByVoiceReq,
|
||||
];
|
||||
@override
|
||||
final String wireName = 'GSearchPlacesReq';
|
||||
final String wireName = 'GRecommendPlacesByVoiceReq';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(
|
||||
Serializers serializers,
|
||||
GSearchPlacesReq object, {
|
||||
GRecommendPlacesByVoiceReq object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = <Object?>[
|
||||
'vars',
|
||||
serializers.serialize(
|
||||
object.vars,
|
||||
specifiedType: const FullType(_i3.GSearchPlacesVars),
|
||||
specifiedType: const FullType(_i3.GRecommendPlacesByVoiceVars),
|
||||
),
|
||||
'operation',
|
||||
serializers.serialize(
|
||||
@@ -55,7 +58,7 @@ class _$GSearchPlacesReqSerializer
|
||||
..add(
|
||||
serializers.serialize(
|
||||
value,
|
||||
specifiedType: const FullType(_i2.GSearchPlacesData),
|
||||
specifiedType: const FullType(_i2.GRecommendPlacesByVoiceData),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -96,12 +99,12 @@ class _$GSearchPlacesReqSerializer
|
||||
}
|
||||
|
||||
@override
|
||||
GSearchPlacesReq deserialize(
|
||||
GRecommendPlacesByVoiceReq deserialize(
|
||||
Serializers serializers,
|
||||
Iterable<Object?> serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = GSearchPlacesReqBuilder();
|
||||
final result = GRecommendPlacesByVoiceReqBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
@@ -113,9 +116,11 @@ class _$GSearchPlacesReqSerializer
|
||||
result.vars.replace(
|
||||
serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(_i3.GSearchPlacesVars),
|
||||
specifiedType: const FullType(
|
||||
_i3.GRecommendPlacesByVoiceVars,
|
||||
),
|
||||
)!
|
||||
as _i3.GSearchPlacesVars,
|
||||
as _i3.GRecommendPlacesByVoiceVars,
|
||||
);
|
||||
break;
|
||||
case 'operation':
|
||||
@@ -138,9 +143,11 @@ class _$GSearchPlacesReqSerializer
|
||||
result.optimisticResponse.replace(
|
||||
serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(_i2.GSearchPlacesData),
|
||||
specifiedType: const FullType(
|
||||
_i2.GRecommendPlacesByVoiceData,
|
||||
),
|
||||
)!
|
||||
as _i2.GSearchPlacesData,
|
||||
as _i2.GRecommendPlacesByVoiceData,
|
||||
);
|
||||
break;
|
||||
case 'updateCacheHandlerKey':
|
||||
@@ -185,21 +192,21 @@ class _$GSearchPlacesReqSerializer
|
||||
}
|
||||
}
|
||||
|
||||
class _$GSearchPlacesReq extends GSearchPlacesReq {
|
||||
class _$GRecommendPlacesByVoiceReq extends GRecommendPlacesByVoiceReq {
|
||||
@override
|
||||
final _i3.GSearchPlacesVars vars;
|
||||
final _i3.GRecommendPlacesByVoiceVars vars;
|
||||
@override
|
||||
final _i4.Operation operation;
|
||||
@override
|
||||
final String? requestId;
|
||||
@override
|
||||
final _i2.GSearchPlacesData? Function(
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GSearchPlacesData?,
|
||||
final _i2.GRecommendPlacesByVoiceData? Function(
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
)?
|
||||
updateResult;
|
||||
@override
|
||||
final _i2.GSearchPlacesData? optimisticResponse;
|
||||
final _i2.GRecommendPlacesByVoiceData? optimisticResponse;
|
||||
@override
|
||||
final String? updateCacheHandlerKey;
|
||||
@override
|
||||
@@ -211,11 +218,11 @@ class _$GSearchPlacesReq extends GSearchPlacesReq {
|
||||
@override
|
||||
final _i4.Context? context;
|
||||
|
||||
factory _$GSearchPlacesReq([
|
||||
void Function(GSearchPlacesReqBuilder)? updates,
|
||||
]) => (GSearchPlacesReqBuilder()..update(updates))._build();
|
||||
factory _$GRecommendPlacesByVoiceReq([
|
||||
void Function(GRecommendPlacesByVoiceReqBuilder)? updates,
|
||||
]) => (GRecommendPlacesByVoiceReqBuilder()..update(updates))._build();
|
||||
|
||||
_$GSearchPlacesReq._({
|
||||
_$GRecommendPlacesByVoiceReq._({
|
||||
required this.vars,
|
||||
required this.operation,
|
||||
this.requestId,
|
||||
@@ -228,17 +235,18 @@ class _$GSearchPlacesReq extends GSearchPlacesReq {
|
||||
this.context,
|
||||
}) : super._();
|
||||
@override
|
||||
GSearchPlacesReq rebuild(void Function(GSearchPlacesReqBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
GRecommendPlacesByVoiceReq rebuild(
|
||||
void Function(GRecommendPlacesByVoiceReqBuilder) updates,
|
||||
) => (toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
GSearchPlacesReqBuilder toBuilder() =>
|
||||
GSearchPlacesReqBuilder()..replace(this);
|
||||
GRecommendPlacesByVoiceReqBuilder toBuilder() =>
|
||||
GRecommendPlacesByVoiceReqBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is GSearchPlacesReq &&
|
||||
return other is GRecommendPlacesByVoiceReq &&
|
||||
vars == other.vars &&
|
||||
operation == other.operation &&
|
||||
requestId == other.requestId &&
|
||||
@@ -270,7 +278,7 @@ class _$GSearchPlacesReq extends GSearchPlacesReq {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(r'GSearchPlacesReq')
|
||||
return (newBuiltValueToStringHelper(r'GRecommendPlacesByVoiceReq')
|
||||
..add('vars', vars)
|
||||
..add('operation', operation)
|
||||
..add('requestId', requestId)
|
||||
@@ -285,14 +293,15 @@ class _$GSearchPlacesReq extends GSearchPlacesReq {
|
||||
}
|
||||
}
|
||||
|
||||
class GSearchPlacesReqBuilder
|
||||
implements Builder<GSearchPlacesReq, GSearchPlacesReqBuilder> {
|
||||
_$GSearchPlacesReq? _$v;
|
||||
class GRecommendPlacesByVoiceReqBuilder
|
||||
implements
|
||||
Builder<GRecommendPlacesByVoiceReq, GRecommendPlacesByVoiceReqBuilder> {
|
||||
_$GRecommendPlacesByVoiceReq? _$v;
|
||||
|
||||
_i3.GSearchPlacesVarsBuilder? _vars;
|
||||
_i3.GSearchPlacesVarsBuilder get vars =>
|
||||
_$this._vars ??= _i3.GSearchPlacesVarsBuilder();
|
||||
set vars(_i3.GSearchPlacesVarsBuilder? vars) => _$this._vars = vars;
|
||||
_i3.GRecommendPlacesByVoiceVarsBuilder? _vars;
|
||||
_i3.GRecommendPlacesByVoiceVarsBuilder get vars =>
|
||||
_$this._vars ??= _i3.GRecommendPlacesByVoiceVarsBuilder();
|
||||
set vars(_i3.GRecommendPlacesByVoiceVarsBuilder? vars) => _$this._vars = vars;
|
||||
|
||||
_i4.Operation? _operation;
|
||||
_i4.Operation? get operation => _$this._operation;
|
||||
@@ -302,29 +311,30 @@ class GSearchPlacesReqBuilder
|
||||
String? get requestId => _$this._requestId;
|
||||
set requestId(String? requestId) => _$this._requestId = requestId;
|
||||
|
||||
_i2.GSearchPlacesData? Function(
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GRecommendPlacesByVoiceData? Function(
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
)?
|
||||
_updateResult;
|
||||
_i2.GSearchPlacesData? Function(
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GRecommendPlacesByVoiceData? Function(
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
)?
|
||||
get updateResult => _$this._updateResult;
|
||||
set updateResult(
|
||||
_i2.GSearchPlacesData? Function(
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GSearchPlacesData?,
|
||||
_i2.GRecommendPlacesByVoiceData? Function(
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
_i2.GRecommendPlacesByVoiceData?,
|
||||
)?
|
||||
updateResult,
|
||||
) => _$this._updateResult = updateResult;
|
||||
|
||||
_i2.GSearchPlacesDataBuilder? _optimisticResponse;
|
||||
_i2.GSearchPlacesDataBuilder get optimisticResponse =>
|
||||
_$this._optimisticResponse ??= _i2.GSearchPlacesDataBuilder();
|
||||
set optimisticResponse(_i2.GSearchPlacesDataBuilder? optimisticResponse) =>
|
||||
_$this._optimisticResponse = optimisticResponse;
|
||||
_i2.GRecommendPlacesByVoiceDataBuilder? _optimisticResponse;
|
||||
_i2.GRecommendPlacesByVoiceDataBuilder get optimisticResponse =>
|
||||
_$this._optimisticResponse ??= _i2.GRecommendPlacesByVoiceDataBuilder();
|
||||
set optimisticResponse(
|
||||
_i2.GRecommendPlacesByVoiceDataBuilder? optimisticResponse,
|
||||
) => _$this._optimisticResponse = optimisticResponse;
|
||||
|
||||
String? _updateCacheHandlerKey;
|
||||
String? get updateCacheHandlerKey => _$this._updateCacheHandlerKey;
|
||||
@@ -352,11 +362,11 @@ class GSearchPlacesReqBuilder
|
||||
_i4.Context? get context => _$this._context;
|
||||
set context(_i4.Context? context) => _$this._context = context;
|
||||
|
||||
GSearchPlacesReqBuilder() {
|
||||
GSearchPlacesReq._initializeBuilder(this);
|
||||
GRecommendPlacesByVoiceReqBuilder() {
|
||||
GRecommendPlacesByVoiceReq._initializeBuilder(this);
|
||||
}
|
||||
|
||||
GSearchPlacesReqBuilder get _$this {
|
||||
GRecommendPlacesByVoiceReqBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_vars = $v.vars.toBuilder();
|
||||
@@ -375,28 +385,28 @@ class GSearchPlacesReqBuilder
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(GSearchPlacesReq other) {
|
||||
_$v = other as _$GSearchPlacesReq;
|
||||
void replace(GRecommendPlacesByVoiceReq other) {
|
||||
_$v = other as _$GRecommendPlacesByVoiceReq;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(GSearchPlacesReqBuilder)? updates) {
|
||||
void update(void Function(GRecommendPlacesByVoiceReqBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
GSearchPlacesReq build() => _build();
|
||||
GRecommendPlacesByVoiceReq build() => _build();
|
||||
|
||||
_$GSearchPlacesReq _build() {
|
||||
_$GSearchPlacesReq _$result;
|
||||
_$GRecommendPlacesByVoiceReq _build() {
|
||||
_$GRecommendPlacesByVoiceReq _$result;
|
||||
try {
|
||||
_$result =
|
||||
_$v ??
|
||||
_$GSearchPlacesReq._(
|
||||
_$GRecommendPlacesByVoiceReq._(
|
||||
vars: vars.build(),
|
||||
operation: BuiltValueNullFieldError.checkNotNull(
|
||||
operation,
|
||||
r'GSearchPlacesReq',
|
||||
r'GRecommendPlacesByVoiceReq',
|
||||
'operation',
|
||||
),
|
||||
requestId: requestId,
|
||||
@@ -407,7 +417,7 @@ class GSearchPlacesReqBuilder
|
||||
fetchPolicy: fetchPolicy,
|
||||
executeOnListen: BuiltValueNullFieldError.checkNotNull(
|
||||
executeOnListen,
|
||||
r'GSearchPlacesReq',
|
||||
r'GRecommendPlacesByVoiceReq',
|
||||
'executeOnListen',
|
||||
),
|
||||
context: context,
|
||||
@@ -422,7 +432,7 @@ class GSearchPlacesReqBuilder
|
||||
_optimisticResponse?.build();
|
||||
} catch (e) {
|
||||
throw BuiltValueNestedFieldError(
|
||||
r'GSearchPlacesReq',
|
||||
r'GRecommendPlacesByVoiceReq',
|
||||
_$failedField,
|
||||
e.toString(),
|
||||
);
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/schema.schema.gql.dart'
|
||||
as _i1;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/serializers.gql.dart'
|
||||
as _i2;
|
||||
|
||||
part 'recommend_places_by_voice.var.gql.g.dart';
|
||||
|
||||
abstract class GRecommendPlacesByVoiceVars
|
||||
implements
|
||||
Built<GRecommendPlacesByVoiceVars, GRecommendPlacesByVoiceVarsBuilder> {
|
||||
GRecommendPlacesByVoiceVars._();
|
||||
|
||||
factory GRecommendPlacesByVoiceVars([
|
||||
void Function(GRecommendPlacesByVoiceVarsBuilder b) updates,
|
||||
]) = _$GRecommendPlacesByVoiceVars;
|
||||
|
||||
_i1.GVoicePlaceRecommendationsInput get input;
|
||||
static Serializer<GRecommendPlacesByVoiceVars> get serializer =>
|
||||
_$gRecommendPlacesByVoiceVarsSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i2.serializers.serializeWith(
|
||||
GRecommendPlacesByVoiceVars.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GRecommendPlacesByVoiceVars? fromJson(Map<String, dynamic> json) => _i2
|
||||
.serializers
|
||||
.deserializeWith(GRecommendPlacesByVoiceVars.serializer, json);
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'recommend_places_by_voice.var.gql.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Serializer<GRecommendPlacesByVoiceVars>
|
||||
_$gRecommendPlacesByVoiceVarsSerializer =
|
||||
_$GRecommendPlacesByVoiceVarsSerializer();
|
||||
|
||||
class _$GRecommendPlacesByVoiceVarsSerializer
|
||||
implements StructuredSerializer<GRecommendPlacesByVoiceVars> {
|
||||
@override
|
||||
final Iterable<Type> types = const [
|
||||
GRecommendPlacesByVoiceVars,
|
||||
_$GRecommendPlacesByVoiceVars,
|
||||
];
|
||||
@override
|
||||
final String wireName = 'GRecommendPlacesByVoiceVars';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(
|
||||
Serializers serializers,
|
||||
GRecommendPlacesByVoiceVars object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = <Object?>[
|
||||
'input',
|
||||
serializers.serialize(
|
||||
object.input,
|
||||
specifiedType: const FullType(_i1.GVoicePlaceRecommendationsInput),
|
||||
),
|
||||
];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
GRecommendPlacesByVoiceVars deserialize(
|
||||
Serializers serializers,
|
||||
Iterable<Object?> serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = GRecommendPlacesByVoiceVarsBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current! as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
switch (key) {
|
||||
case 'input':
|
||||
result.input.replace(
|
||||
serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(
|
||||
_i1.GVoicePlaceRecommendationsInput,
|
||||
),
|
||||
)!
|
||||
as _i1.GVoicePlaceRecommendationsInput,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class _$GRecommendPlacesByVoiceVars extends GRecommendPlacesByVoiceVars {
|
||||
@override
|
||||
final _i1.GVoicePlaceRecommendationsInput input;
|
||||
|
||||
factory _$GRecommendPlacesByVoiceVars([
|
||||
void Function(GRecommendPlacesByVoiceVarsBuilder)? updates,
|
||||
]) => (GRecommendPlacesByVoiceVarsBuilder()..update(updates))._build();
|
||||
|
||||
_$GRecommendPlacesByVoiceVars._({required this.input}) : super._();
|
||||
@override
|
||||
GRecommendPlacesByVoiceVars rebuild(
|
||||
void Function(GRecommendPlacesByVoiceVarsBuilder) updates,
|
||||
) => (toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
GRecommendPlacesByVoiceVarsBuilder toBuilder() =>
|
||||
GRecommendPlacesByVoiceVarsBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is GRecommendPlacesByVoiceVars && input == other.input;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, input.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(
|
||||
r'GRecommendPlacesByVoiceVars',
|
||||
)..add('input', input)).toString();
|
||||
}
|
||||
}
|
||||
|
||||
class GRecommendPlacesByVoiceVarsBuilder
|
||||
implements
|
||||
Builder<
|
||||
GRecommendPlacesByVoiceVars,
|
||||
GRecommendPlacesByVoiceVarsBuilder
|
||||
> {
|
||||
_$GRecommendPlacesByVoiceVars? _$v;
|
||||
|
||||
_i1.GVoicePlaceRecommendationsInputBuilder? _input;
|
||||
_i1.GVoicePlaceRecommendationsInputBuilder get input =>
|
||||
_$this._input ??= _i1.GVoicePlaceRecommendationsInputBuilder();
|
||||
set input(_i1.GVoicePlaceRecommendationsInputBuilder? input) =>
|
||||
_$this._input = input;
|
||||
|
||||
GRecommendPlacesByVoiceVarsBuilder();
|
||||
|
||||
GRecommendPlacesByVoiceVarsBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_input = $v.input.toBuilder();
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(GRecommendPlacesByVoiceVars other) {
|
||||
_$v = other as _$GRecommendPlacesByVoiceVars;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(GRecommendPlacesByVoiceVarsBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
GRecommendPlacesByVoiceVars build() => _build();
|
||||
|
||||
_$GRecommendPlacesByVoiceVars _build() {
|
||||
_$GRecommendPlacesByVoiceVars _$result;
|
||||
try {
|
||||
_$result = _$v ?? _$GRecommendPlacesByVoiceVars._(input: input.build());
|
||||
} catch (_) {
|
||||
late String _$failedField;
|
||||
try {
|
||||
_$failedField = 'input';
|
||||
input.build();
|
||||
} catch (e) {
|
||||
throw BuiltValueNestedFieldError(
|
||||
r'GRecommendPlacesByVoiceVars',
|
||||
_$failedField,
|
||||
e.toString(),
|
||||
);
|
||||
}
|
||||
rethrow;
|
||||
}
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
+57
-27
@@ -569,12 +569,21 @@ const NearbyPlacesInput = _i1.InputObjectTypeDefinitionNode(
|
||||
),
|
||||
],
|
||||
);
|
||||
const SearchPlacesInput = _i1.InputObjectTypeDefinitionNode(
|
||||
name: _i1.NameNode(value: 'SearchPlacesInput'),
|
||||
const VoicePlaceRecommendationsInput = _i1.InputObjectTypeDefinitionNode(
|
||||
name: _i1.NameNode(value: 'VoicePlaceRecommendationsInput'),
|
||||
directives: [],
|
||||
fields: [
|
||||
_i1.InputValueDefinitionNode(
|
||||
name: _i1.NameNode(value: 'query'),
|
||||
name: _i1.NameNode(value: 'audioContentBase64'),
|
||||
directives: [],
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'String'),
|
||||
isNonNull: true,
|
||||
),
|
||||
defaultValue: null,
|
||||
),
|
||||
_i1.InputValueDefinitionNode(
|
||||
name: _i1.NameNode(value: 'audioMimeType'),
|
||||
directives: [],
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'String'),
|
||||
@@ -743,13 +752,34 @@ const TelegramBotLoginSession = _i1.ObjectTypeDefinitionNode(
|
||||
),
|
||||
],
|
||||
);
|
||||
const SearchPlacesPayload = _i1.ObjectTypeDefinitionNode(
|
||||
name: _i1.NameNode(value: 'SearchPlacesPayload'),
|
||||
const VoicePlaceRecommendationsPayload = _i1.ObjectTypeDefinitionNode(
|
||||
name: _i1.NameNode(value: 'VoicePlaceRecommendationsPayload'),
|
||||
directives: [],
|
||||
interfaces: [],
|
||||
fields: [
|
||||
_i1.FieldDefinitionNode(
|
||||
name: _i1.NameNode(value: 'message'),
|
||||
name: _i1.NameNode(value: 'transcript'),
|
||||
directives: [],
|
||||
args: [],
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'String'),
|
||||
isNonNull: true,
|
||||
),
|
||||
),
|
||||
_i1.FieldDefinitionNode(
|
||||
name: _i1.NameNode(value: 'tags'),
|
||||
directives: [],
|
||||
args: [],
|
||||
type: _i1.ListTypeNode(
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'String'),
|
||||
isNonNull: true,
|
||||
),
|
||||
isNonNull: true,
|
||||
),
|
||||
),
|
||||
_i1.FieldDefinitionNode(
|
||||
name: _i1.NameNode(value: 'summary'),
|
||||
directives: [],
|
||||
args: [],
|
||||
type: _i1.NamedTypeNode(
|
||||
@@ -840,25 +870,6 @@ const Query = _i1.ObjectTypeDefinitionNode(
|
||||
isNonNull: true,
|
||||
),
|
||||
),
|
||||
_i1.FieldDefinitionNode(
|
||||
name: _i1.NameNode(value: 'searchPlaces'),
|
||||
directives: [],
|
||||
args: [
|
||||
_i1.InputValueDefinitionNode(
|
||||
name: _i1.NameNode(value: 'input'),
|
||||
directives: [],
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'SearchPlacesInput'),
|
||||
isNonNull: true,
|
||||
),
|
||||
defaultValue: null,
|
||||
),
|
||||
],
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'SearchPlacesPayload'),
|
||||
isNonNull: true,
|
||||
),
|
||||
),
|
||||
_i1.FieldDefinitionNode(
|
||||
name: _i1.NameNode(value: 'voiceExperiences'),
|
||||
directives: [],
|
||||
@@ -963,6 +974,25 @@ const Mutation = _i1.ObjectTypeDefinitionNode(
|
||||
isNonNull: true,
|
||||
),
|
||||
),
|
||||
_i1.FieldDefinitionNode(
|
||||
name: _i1.NameNode(value: 'recommendPlacesByVoice'),
|
||||
directives: [],
|
||||
args: [
|
||||
_i1.InputValueDefinitionNode(
|
||||
name: _i1.NameNode(value: 'input'),
|
||||
directives: [],
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'VoicePlaceRecommendationsInput'),
|
||||
isNonNull: true,
|
||||
),
|
||||
defaultValue: null,
|
||||
),
|
||||
],
|
||||
type: _i1.NamedTypeNode(
|
||||
name: _i1.NameNode(value: 'VoicePlaceRecommendationsPayload'),
|
||||
isNonNull: true,
|
||||
),
|
||||
),
|
||||
_i1.FieldDefinitionNode(
|
||||
name: _i1.NameNode(value: 'addFavoritePlace'),
|
||||
directives: [],
|
||||
@@ -1012,13 +1042,13 @@ const document = _i1.DocumentNode(
|
||||
VoiceExperience,
|
||||
CreateVoiceExperienceInput,
|
||||
NearbyPlacesInput,
|
||||
SearchPlacesInput,
|
||||
VoicePlaceRecommendationsInput,
|
||||
AuthenticateTelegramInput,
|
||||
AuthenticateTelegramLoginInput,
|
||||
AuthPayload,
|
||||
TelegramBotLoginPayload,
|
||||
TelegramBotLoginSession,
|
||||
SearchPlacesPayload,
|
||||
VoicePlaceRecommendationsPayload,
|
||||
Query,
|
||||
Mutation,
|
||||
],
|
||||
|
||||
@@ -100,24 +100,35 @@ abstract class GNearbyPlacesInput
|
||||
_i2.serializers.deserializeWith(GNearbyPlacesInput.serializer, json);
|
||||
}
|
||||
|
||||
abstract class GSearchPlacesInput
|
||||
implements Built<GSearchPlacesInput, GSearchPlacesInputBuilder> {
|
||||
GSearchPlacesInput._();
|
||||
abstract class GVoicePlaceRecommendationsInput
|
||||
implements
|
||||
Built<
|
||||
GVoicePlaceRecommendationsInput,
|
||||
GVoicePlaceRecommendationsInputBuilder
|
||||
> {
|
||||
GVoicePlaceRecommendationsInput._();
|
||||
|
||||
factory GSearchPlacesInput([
|
||||
void Function(GSearchPlacesInputBuilder b) updates,
|
||||
]) = _$GSearchPlacesInput;
|
||||
factory GVoicePlaceRecommendationsInput([
|
||||
void Function(GVoicePlaceRecommendationsInputBuilder b) updates,
|
||||
]) = _$GVoicePlaceRecommendationsInput;
|
||||
|
||||
String get query;
|
||||
static Serializer<GSearchPlacesInput> get serializer =>
|
||||
_$gSearchPlacesInputSerializer;
|
||||
String get audioContentBase64;
|
||||
String get audioMimeType;
|
||||
static Serializer<GVoicePlaceRecommendationsInput> get serializer =>
|
||||
_$gVoicePlaceRecommendationsInputSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i2.serializers.serializeWith(GSearchPlacesInput.serializer, this)
|
||||
(_i2.serializers.serializeWith(
|
||||
GVoicePlaceRecommendationsInput.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GSearchPlacesInput? fromJson(Map<String, dynamic> json) =>
|
||||
_i2.serializers.deserializeWith(GSearchPlacesInput.serializer, json);
|
||||
static GVoicePlaceRecommendationsInput? fromJson(Map<String, dynamic> json) =>
|
||||
_i2.serializers.deserializeWith(
|
||||
GVoicePlaceRecommendationsInput.serializer,
|
||||
json,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class GAuthenticateTelegramInput
|
||||
|
||||
+92
-49
@@ -55,8 +55,9 @@ _$gCreateVoiceExperienceInputSerializer =
|
||||
_$GCreateVoiceExperienceInputSerializer();
|
||||
Serializer<GNearbyPlacesInput> _$gNearbyPlacesInputSerializer =
|
||||
_$GNearbyPlacesInputSerializer();
|
||||
Serializer<GSearchPlacesInput> _$gSearchPlacesInputSerializer =
|
||||
_$GSearchPlacesInputSerializer();
|
||||
Serializer<GVoicePlaceRecommendationsInput>
|
||||
_$gVoicePlaceRecommendationsInputSerializer =
|
||||
_$GVoicePlaceRecommendationsInputSerializer();
|
||||
Serializer<GAuthenticateTelegramInput> _$gAuthenticateTelegramInputSerializer =
|
||||
_$GAuthenticateTelegramInputSerializer();
|
||||
Serializer<GAuthenticateTelegramLoginInput>
|
||||
@@ -410,23 +411,31 @@ class _$GNearbyPlacesInputSerializer
|
||||
}
|
||||
}
|
||||
|
||||
class _$GSearchPlacesInputSerializer
|
||||
implements StructuredSerializer<GSearchPlacesInput> {
|
||||
class _$GVoicePlaceRecommendationsInputSerializer
|
||||
implements StructuredSerializer<GVoicePlaceRecommendationsInput> {
|
||||
@override
|
||||
final Iterable<Type> types = const [GSearchPlacesInput, _$GSearchPlacesInput];
|
||||
final Iterable<Type> types = const [
|
||||
GVoicePlaceRecommendationsInput,
|
||||
_$GVoicePlaceRecommendationsInput,
|
||||
];
|
||||
@override
|
||||
final String wireName = 'GSearchPlacesInput';
|
||||
final String wireName = 'GVoicePlaceRecommendationsInput';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(
|
||||
Serializers serializers,
|
||||
GSearchPlacesInput object, {
|
||||
GVoicePlaceRecommendationsInput object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = <Object?>[
|
||||
'query',
|
||||
'audioContentBase64',
|
||||
serializers.serialize(
|
||||
object.query,
|
||||
object.audioContentBase64,
|
||||
specifiedType: const FullType(String),
|
||||
),
|
||||
'audioMimeType',
|
||||
serializers.serialize(
|
||||
object.audioMimeType,
|
||||
specifiedType: const FullType(String),
|
||||
),
|
||||
];
|
||||
@@ -435,12 +444,12 @@ class _$GSearchPlacesInputSerializer
|
||||
}
|
||||
|
||||
@override
|
||||
GSearchPlacesInput deserialize(
|
||||
GVoicePlaceRecommendationsInput deserialize(
|
||||
Serializers serializers,
|
||||
Iterable<Object?> serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = GSearchPlacesInputBuilder();
|
||||
final result = GVoicePlaceRecommendationsInputBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
@@ -448,8 +457,16 @@ class _$GSearchPlacesInputSerializer
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
switch (key) {
|
||||
case 'query':
|
||||
result.query =
|
||||
case 'audioContentBase64':
|
||||
result.audioContentBase64 =
|
||||
serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
)!
|
||||
as String;
|
||||
break;
|
||||
case 'audioMimeType':
|
||||
result.audioMimeType =
|
||||
serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
@@ -1078,86 +1095,112 @@ class GNearbyPlacesInputBuilder
|
||||
}
|
||||
}
|
||||
|
||||
class _$GSearchPlacesInput extends GSearchPlacesInput {
|
||||
class _$GVoicePlaceRecommendationsInput
|
||||
extends GVoicePlaceRecommendationsInput {
|
||||
@override
|
||||
final String query;
|
||||
|
||||
factory _$GSearchPlacesInput([
|
||||
void Function(GSearchPlacesInputBuilder)? updates,
|
||||
]) => (GSearchPlacesInputBuilder()..update(updates))._build();
|
||||
|
||||
_$GSearchPlacesInput._({required this.query}) : super._();
|
||||
final String audioContentBase64;
|
||||
@override
|
||||
GSearchPlacesInput rebuild(
|
||||
void Function(GSearchPlacesInputBuilder) updates,
|
||||
final String audioMimeType;
|
||||
|
||||
factory _$GVoicePlaceRecommendationsInput([
|
||||
void Function(GVoicePlaceRecommendationsInputBuilder)? updates,
|
||||
]) => (GVoicePlaceRecommendationsInputBuilder()..update(updates))._build();
|
||||
|
||||
_$GVoicePlaceRecommendationsInput._({
|
||||
required this.audioContentBase64,
|
||||
required this.audioMimeType,
|
||||
}) : super._();
|
||||
@override
|
||||
GVoicePlaceRecommendationsInput rebuild(
|
||||
void Function(GVoicePlaceRecommendationsInputBuilder) updates,
|
||||
) => (toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
GSearchPlacesInputBuilder toBuilder() =>
|
||||
GSearchPlacesInputBuilder()..replace(this);
|
||||
GVoicePlaceRecommendationsInputBuilder toBuilder() =>
|
||||
GVoicePlaceRecommendationsInputBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is GSearchPlacesInput && query == other.query;
|
||||
return other is GVoicePlaceRecommendationsInput &&
|
||||
audioContentBase64 == other.audioContentBase64 &&
|
||||
audioMimeType == other.audioMimeType;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, query.hashCode);
|
||||
_$hash = $jc(_$hash, audioContentBase64.hashCode);
|
||||
_$hash = $jc(_$hash, audioMimeType.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(
|
||||
r'GSearchPlacesInput',
|
||||
)..add('query', query)).toString();
|
||||
return (newBuiltValueToStringHelper(r'GVoicePlaceRecommendationsInput')
|
||||
..add('audioContentBase64', audioContentBase64)
|
||||
..add('audioMimeType', audioMimeType))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class GSearchPlacesInputBuilder
|
||||
implements Builder<GSearchPlacesInput, GSearchPlacesInputBuilder> {
|
||||
_$GSearchPlacesInput? _$v;
|
||||
class GVoicePlaceRecommendationsInputBuilder
|
||||
implements
|
||||
Builder<
|
||||
GVoicePlaceRecommendationsInput,
|
||||
GVoicePlaceRecommendationsInputBuilder
|
||||
> {
|
||||
_$GVoicePlaceRecommendationsInput? _$v;
|
||||
|
||||
String? _query;
|
||||
String? get query => _$this._query;
|
||||
set query(String? query) => _$this._query = query;
|
||||
String? _audioContentBase64;
|
||||
String? get audioContentBase64 => _$this._audioContentBase64;
|
||||
set audioContentBase64(String? audioContentBase64) =>
|
||||
_$this._audioContentBase64 = audioContentBase64;
|
||||
|
||||
GSearchPlacesInputBuilder();
|
||||
String? _audioMimeType;
|
||||
String? get audioMimeType => _$this._audioMimeType;
|
||||
set audioMimeType(String? audioMimeType) =>
|
||||
_$this._audioMimeType = audioMimeType;
|
||||
|
||||
GSearchPlacesInputBuilder get _$this {
|
||||
GVoicePlaceRecommendationsInputBuilder();
|
||||
|
||||
GVoicePlaceRecommendationsInputBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_query = $v.query;
|
||||
_audioContentBase64 = $v.audioContentBase64;
|
||||
_audioMimeType = $v.audioMimeType;
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(GSearchPlacesInput other) {
|
||||
_$v = other as _$GSearchPlacesInput;
|
||||
void replace(GVoicePlaceRecommendationsInput other) {
|
||||
_$v = other as _$GVoicePlaceRecommendationsInput;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(GSearchPlacesInputBuilder)? updates) {
|
||||
void update(void Function(GVoicePlaceRecommendationsInputBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
GSearchPlacesInput build() => _build();
|
||||
GVoicePlaceRecommendationsInput build() => _build();
|
||||
|
||||
_$GSearchPlacesInput _build() {
|
||||
_$GVoicePlaceRecommendationsInput _build() {
|
||||
final _$result =
|
||||
_$v ??
|
||||
_$GSearchPlacesInput._(
|
||||
query: BuiltValueNullFieldError.checkNotNull(
|
||||
query,
|
||||
r'GSearchPlacesInput',
|
||||
'query',
|
||||
_$GVoicePlaceRecommendationsInput._(
|
||||
audioContentBase64: BuiltValueNullFieldError.checkNotNull(
|
||||
audioContentBase64,
|
||||
r'GVoicePlaceRecommendationsInput',
|
||||
'audioContentBase64',
|
||||
),
|
||||
audioMimeType: BuiltValueNullFieldError.checkNotNull(
|
||||
audioMimeType,
|
||||
r'GVoicePlaceRecommendationsInput',
|
||||
'audioMimeType',
|
||||
),
|
||||
);
|
||||
replace(_$result);
|
||||
|
||||
-167
@@ -1,167 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/json_object.dart' as _i2;
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/schema.schema.gql.dart'
|
||||
as _i3;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/serializers.gql.dart'
|
||||
as _i1;
|
||||
|
||||
part 'search_places.data.gql.g.dart';
|
||||
|
||||
abstract class GSearchPlacesData
|
||||
implements Built<GSearchPlacesData, GSearchPlacesDataBuilder> {
|
||||
GSearchPlacesData._();
|
||||
|
||||
factory GSearchPlacesData([
|
||||
void Function(GSearchPlacesDataBuilder b) updates,
|
||||
]) = _$GSearchPlacesData;
|
||||
|
||||
static void _initializeBuilder(GSearchPlacesDataBuilder b) =>
|
||||
b..G__typename = 'Query';
|
||||
|
||||
@BuiltValueField(wireName: '__typename')
|
||||
String get G__typename;
|
||||
GSearchPlacesData_searchPlaces get searchPlaces;
|
||||
static Serializer<GSearchPlacesData> get serializer =>
|
||||
_$gSearchPlacesDataSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i1.serializers.serializeWith(GSearchPlacesData.serializer, this)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GSearchPlacesData? fromJson(Map<String, dynamic> json) =>
|
||||
_i1.serializers.deserializeWith(GSearchPlacesData.serializer, json);
|
||||
}
|
||||
|
||||
abstract class GSearchPlacesData_searchPlaces
|
||||
implements
|
||||
Built<
|
||||
GSearchPlacesData_searchPlaces,
|
||||
GSearchPlacesData_searchPlacesBuilder
|
||||
> {
|
||||
GSearchPlacesData_searchPlaces._();
|
||||
|
||||
factory GSearchPlacesData_searchPlaces([
|
||||
void Function(GSearchPlacesData_searchPlacesBuilder b) updates,
|
||||
]) = _$GSearchPlacesData_searchPlaces;
|
||||
|
||||
static void _initializeBuilder(GSearchPlacesData_searchPlacesBuilder b) =>
|
||||
b..G__typename = 'SearchPlacesPayload';
|
||||
|
||||
@BuiltValueField(wireName: '__typename')
|
||||
String get G__typename;
|
||||
String get message;
|
||||
BuiltList<GSearchPlacesData_searchPlaces_places> get places;
|
||||
static Serializer<GSearchPlacesData_searchPlaces> get serializer =>
|
||||
_$gSearchPlacesDataSearchPlacesSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i1.serializers.serializeWith(
|
||||
GSearchPlacesData_searchPlaces.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GSearchPlacesData_searchPlaces? fromJson(Map<String, dynamic> json) =>
|
||||
_i1.serializers.deserializeWith(
|
||||
GSearchPlacesData_searchPlaces.serializer,
|
||||
json,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class GSearchPlacesData_searchPlaces_places
|
||||
implements
|
||||
Built<
|
||||
GSearchPlacesData_searchPlaces_places,
|
||||
GSearchPlacesData_searchPlaces_placesBuilder
|
||||
> {
|
||||
GSearchPlacesData_searchPlaces_places._();
|
||||
|
||||
factory GSearchPlacesData_searchPlaces_places([
|
||||
void Function(GSearchPlacesData_searchPlaces_placesBuilder b) updates,
|
||||
]) = _$GSearchPlacesData_searchPlaces_places;
|
||||
|
||||
static void _initializeBuilder(
|
||||
GSearchPlacesData_searchPlaces_placesBuilder b,
|
||||
) => b..G__typename = 'Place';
|
||||
|
||||
@BuiltValueField(wireName: '__typename')
|
||||
String get G__typename;
|
||||
String get id;
|
||||
String get googlePlaceId;
|
||||
String get name;
|
||||
double get latitude;
|
||||
double get longitude;
|
||||
String? get googlePrimaryType;
|
||||
BuiltList<String> get googleTypes;
|
||||
String? get googleBusinessStatus;
|
||||
double? get googleRating;
|
||||
int? get googleUserRatingCount;
|
||||
_i2.JsonObject? get googleRegularOpeningHours;
|
||||
_i2.JsonObject? get googleCurrentOpeningHours;
|
||||
BuiltList<String> get photoUrls;
|
||||
BuiltList<String> get traits;
|
||||
bool get isFavorite;
|
||||
BuiltList<GSearchPlacesData_searchPlaces_places_experiences> get experiences;
|
||||
static Serializer<GSearchPlacesData_searchPlaces_places> get serializer =>
|
||||
_$gSearchPlacesDataSearchPlacesPlacesSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i1.serializers.serializeWith(
|
||||
GSearchPlacesData_searchPlaces_places.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GSearchPlacesData_searchPlaces_places? fromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _i1.serializers.deserializeWith(
|
||||
GSearchPlacesData_searchPlaces_places.serializer,
|
||||
json,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class GSearchPlacesData_searchPlaces_places_experiences
|
||||
implements
|
||||
Built<
|
||||
GSearchPlacesData_searchPlaces_places_experiences,
|
||||
GSearchPlacesData_searchPlaces_places_experiencesBuilder
|
||||
> {
|
||||
GSearchPlacesData_searchPlaces_places_experiences._();
|
||||
|
||||
factory GSearchPlacesData_searchPlaces_places_experiences([
|
||||
void Function(GSearchPlacesData_searchPlaces_places_experiencesBuilder b)
|
||||
updates,
|
||||
]) = _$GSearchPlacesData_searchPlaces_places_experiences;
|
||||
|
||||
static void _initializeBuilder(
|
||||
GSearchPlacesData_searchPlaces_places_experiencesBuilder b,
|
||||
) => b..G__typename = 'VoiceExperience';
|
||||
|
||||
@BuiltValueField(wireName: '__typename')
|
||||
String get G__typename;
|
||||
String get id;
|
||||
_i3.GVoiceExperienceStatus get status;
|
||||
String get createdAt;
|
||||
static Serializer<GSearchPlacesData_searchPlaces_places_experiences>
|
||||
get serializer => _$gSearchPlacesDataSearchPlacesPlacesExperiencesSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i1.serializers.serializeWith(
|
||||
GSearchPlacesData_searchPlaces_places_experiences.serializer,
|
||||
this,
|
||||
)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GSearchPlacesData_searchPlaces_places_experiences? fromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _i1.serializers.deserializeWith(
|
||||
GSearchPlacesData_searchPlaces_places_experiences.serializer,
|
||||
json,
|
||||
);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/schema.schema.gql.dart'
|
||||
as _i1;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/serializers.gql.dart'
|
||||
as _i2;
|
||||
|
||||
part 'search_places.var.gql.g.dart';
|
||||
|
||||
abstract class GSearchPlacesVars
|
||||
implements Built<GSearchPlacesVars, GSearchPlacesVarsBuilder> {
|
||||
GSearchPlacesVars._();
|
||||
|
||||
factory GSearchPlacesVars([
|
||||
void Function(GSearchPlacesVarsBuilder b) updates,
|
||||
]) = _$GSearchPlacesVars;
|
||||
|
||||
_i1.GSearchPlacesInput get input;
|
||||
static Serializer<GSearchPlacesVars> get serializer =>
|
||||
_$gSearchPlacesVarsSerializer;
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
(_i2.serializers.serializeWith(GSearchPlacesVars.serializer, this)
|
||||
as Map<String, dynamic>);
|
||||
|
||||
static GSearchPlacesVars? fromJson(Map<String, dynamic> json) =>
|
||||
_i2.serializers.deserializeWith(GSearchPlacesVars.serializer, json);
|
||||
}
|
||||
-161
@@ -1,161 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'search_places.var.gql.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Serializer<GSearchPlacesVars> _$gSearchPlacesVarsSerializer =
|
||||
_$GSearchPlacesVarsSerializer();
|
||||
|
||||
class _$GSearchPlacesVarsSerializer
|
||||
implements StructuredSerializer<GSearchPlacesVars> {
|
||||
@override
|
||||
final Iterable<Type> types = const [GSearchPlacesVars, _$GSearchPlacesVars];
|
||||
@override
|
||||
final String wireName = 'GSearchPlacesVars';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(
|
||||
Serializers serializers,
|
||||
GSearchPlacesVars object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = <Object?>[
|
||||
'input',
|
||||
serializers.serialize(
|
||||
object.input,
|
||||
specifiedType: const FullType(_i1.GSearchPlacesInput),
|
||||
),
|
||||
];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
GSearchPlacesVars deserialize(
|
||||
Serializers serializers,
|
||||
Iterable<Object?> serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = GSearchPlacesVarsBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current! as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
switch (key) {
|
||||
case 'input':
|
||||
result.input.replace(
|
||||
serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(_i1.GSearchPlacesInput),
|
||||
)!
|
||||
as _i1.GSearchPlacesInput,
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class _$GSearchPlacesVars extends GSearchPlacesVars {
|
||||
@override
|
||||
final _i1.GSearchPlacesInput input;
|
||||
|
||||
factory _$GSearchPlacesVars([
|
||||
void Function(GSearchPlacesVarsBuilder)? updates,
|
||||
]) => (GSearchPlacesVarsBuilder()..update(updates))._build();
|
||||
|
||||
_$GSearchPlacesVars._({required this.input}) : super._();
|
||||
@override
|
||||
GSearchPlacesVars rebuild(void Function(GSearchPlacesVarsBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
GSearchPlacesVarsBuilder toBuilder() =>
|
||||
GSearchPlacesVarsBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is GSearchPlacesVars && input == other.input;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var _$hash = 0;
|
||||
_$hash = $jc(_$hash, input.hashCode);
|
||||
_$hash = $jf(_$hash);
|
||||
return _$hash;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper(
|
||||
r'GSearchPlacesVars',
|
||||
)..add('input', input)).toString();
|
||||
}
|
||||
}
|
||||
|
||||
class GSearchPlacesVarsBuilder
|
||||
implements Builder<GSearchPlacesVars, GSearchPlacesVarsBuilder> {
|
||||
_$GSearchPlacesVars? _$v;
|
||||
|
||||
_i1.GSearchPlacesInputBuilder? _input;
|
||||
_i1.GSearchPlacesInputBuilder get input =>
|
||||
_$this._input ??= _i1.GSearchPlacesInputBuilder();
|
||||
set input(_i1.GSearchPlacesInputBuilder? input) => _$this._input = input;
|
||||
|
||||
GSearchPlacesVarsBuilder();
|
||||
|
||||
GSearchPlacesVarsBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_input = $v.input.toBuilder();
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(GSearchPlacesVars other) {
|
||||
_$v = other as _$GSearchPlacesVars;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(GSearchPlacesVarsBuilder)? updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
GSearchPlacesVars build() => _build();
|
||||
|
||||
_$GSearchPlacesVars _build() {
|
||||
_$GSearchPlacesVars _$result;
|
||||
try {
|
||||
_$result = _$v ?? _$GSearchPlacesVars._(input: input.build());
|
||||
} catch (_) {
|
||||
late String _$failedField;
|
||||
try {
|
||||
_$failedField = 'input';
|
||||
input.build();
|
||||
} catch (e) {
|
||||
throw BuiltValueNestedFieldError(
|
||||
r'GSearchPlacesVars',
|
||||
_$failedField,
|
||||
e.toString(),
|
||||
);
|
||||
}
|
||||
rethrow;
|
||||
}
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: deprecated_member_use_from_same_package,type=lint
|
||||
@@ -82,6 +82,16 @@ import 'package:mapflow/features/mapflow/data/graphql/__generated__/places.req.g
|
||||
show GPlacesReq;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/places.var.gql.dart'
|
||||
show GPlacesVars;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/recommend_places_by_voice.data.gql.dart'
|
||||
show
|
||||
GRecommendPlacesByVoiceData,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/recommend_places_by_voice.req.gql.dart'
|
||||
show GRecommendPlacesByVoiceReq;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/recommend_places_by_voice.var.gql.dart'
|
||||
show GRecommendPlacesByVoiceVars;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/remove_favorite_place.data.gql.dart'
|
||||
show
|
||||
GRemoveFavoritePlaceData,
|
||||
@@ -97,18 +107,8 @@ import 'package:mapflow/features/mapflow/data/graphql/__generated__/schema.schem
|
||||
GAuthenticateTelegramLoginInput,
|
||||
GCreateVoiceExperienceInput,
|
||||
GNearbyPlacesInput,
|
||||
GSearchPlacesInput,
|
||||
GVoiceExperienceStatus;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/search_places.data.gql.dart'
|
||||
show
|
||||
GSearchPlacesData,
|
||||
GSearchPlacesData_searchPlaces,
|
||||
GSearchPlacesData_searchPlaces_places,
|
||||
GSearchPlacesData_searchPlaces_places_experiences;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/search_places.req.gql.dart'
|
||||
show GSearchPlacesReq;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/search_places.var.gql.dart'
|
||||
show GSearchPlacesVars;
|
||||
GVoiceExperienceStatus,
|
||||
GVoicePlaceRecommendationsInput;
|
||||
import 'package:mapflow/features/mapflow/data/graphql/__generated__/start_telegram_bot_login.data.gql.dart'
|
||||
show
|
||||
GStartTelegramBotLoginData,
|
||||
@@ -181,18 +181,17 @@ final SerializersBuilder _serializersBuilder = _$serializers.toBuilder()
|
||||
GPlacesData_places_experiences,
|
||||
GPlacesReq,
|
||||
GPlacesVars,
|
||||
GRecommendPlacesByVoiceData,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences,
|
||||
GRecommendPlacesByVoiceReq,
|
||||
GRecommendPlacesByVoiceVars,
|
||||
GRemoveFavoritePlaceData,
|
||||
GRemoveFavoritePlaceData_removeFavoritePlace,
|
||||
GRemoveFavoritePlaceData_removeFavoritePlace_experiences,
|
||||
GRemoveFavoritePlaceReq,
|
||||
GRemoveFavoritePlaceVars,
|
||||
GSearchPlacesData,
|
||||
GSearchPlacesData_searchPlaces,
|
||||
GSearchPlacesData_searchPlaces_places,
|
||||
GSearchPlacesData_searchPlaces_places_experiences,
|
||||
GSearchPlacesInput,
|
||||
GSearchPlacesReq,
|
||||
GSearchPlacesVars,
|
||||
GStartTelegramBotLoginData,
|
||||
GStartTelegramBotLoginData_startTelegramBotLogin,
|
||||
GStartTelegramBotLoginReq,
|
||||
@@ -204,5 +203,6 @@ final SerializersBuilder _serializersBuilder = _$serializers.toBuilder()
|
||||
GVoiceExperiencesData_voiceExperiences_user,
|
||||
GVoiceExperiencesReq,
|
||||
GVoiceExperiencesVars,
|
||||
GVoicePlaceRecommendationsInput,
|
||||
])
|
||||
final Serializers serializers = _serializersBuilder.build();
|
||||
|
||||
@@ -66,6 +66,18 @@ Serializers _$serializers =
|
||||
..add(GPlacesData_places_experiences.serializer)
|
||||
..add(GPlacesReq.serializer)
|
||||
..add(GPlacesVars.serializer)
|
||||
..add(GRecommendPlacesByVoiceData.serializer)
|
||||
..add(GRecommendPlacesByVoiceData_recommendPlacesByVoice.serializer)
|
||||
..add(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places
|
||||
.serializer,
|
||||
)
|
||||
..add(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences
|
||||
.serializer,
|
||||
)
|
||||
..add(GRecommendPlacesByVoiceReq.serializer)
|
||||
..add(GRecommendPlacesByVoiceVars.serializer)
|
||||
..add(GRemoveFavoritePlaceData.serializer)
|
||||
..add(GRemoveFavoritePlaceData_removeFavoritePlace.serializer)
|
||||
..add(
|
||||
@@ -73,13 +85,6 @@ Serializers _$serializers =
|
||||
)
|
||||
..add(GRemoveFavoritePlaceReq.serializer)
|
||||
..add(GRemoveFavoritePlaceVars.serializer)
|
||||
..add(GSearchPlacesData.serializer)
|
||||
..add(GSearchPlacesData_searchPlaces.serializer)
|
||||
..add(GSearchPlacesData_searchPlaces_places.serializer)
|
||||
..add(GSearchPlacesData_searchPlaces_places_experiences.serializer)
|
||||
..add(GSearchPlacesInput.serializer)
|
||||
..add(GSearchPlacesReq.serializer)
|
||||
..add(GSearchPlacesVars.serializer)
|
||||
..add(GStartTelegramBotLoginData.serializer)
|
||||
..add(GStartTelegramBotLoginData_startTelegramBotLogin.serializer)
|
||||
..add(GStartTelegramBotLoginReq.serializer)
|
||||
@@ -91,6 +96,7 @@ Serializers _$serializers =
|
||||
..add(GVoiceExperiencesData_voiceExperiences_user.serializer)
|
||||
..add(GVoiceExperiencesReq.serializer)
|
||||
..add(GVoiceExperiencesVars.serializer)
|
||||
..add(GVoicePlaceRecommendationsInput.serializer)
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, const [
|
||||
const FullType(GFavoritePlacesData_favoritePlaces),
|
||||
@@ -109,12 +115,6 @@ Serializers _$serializers =
|
||||
]),
|
||||
() => ListBuilder<GPlacesData_places>(),
|
||||
)
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, const [
|
||||
const FullType(GSearchPlacesData_searchPlaces_places),
|
||||
]),
|
||||
() => ListBuilder<GSearchPlacesData_searchPlaces_places>(),
|
||||
)
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, const [
|
||||
const FullType(GVoiceExperiencesData_voiceExperiences),
|
||||
@@ -129,6 +129,21 @@ Serializers _$serializers =
|
||||
const FullType(BuiltList, const [const FullType(String)]),
|
||||
() => ListBuilder<String>(),
|
||||
)
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, const [
|
||||
const FullType(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places,
|
||||
),
|
||||
]),
|
||||
() =>
|
||||
ListBuilder<
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places
|
||||
>(),
|
||||
)
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, const [const FullType(String)]),
|
||||
() => ListBuilder<String>(),
|
||||
)
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, const [const FullType(String)]),
|
||||
() => ListBuilder<String>(),
|
||||
@@ -225,12 +240,12 @@ Serializers _$serializers =
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, const [
|
||||
const FullType(
|
||||
GRemoveFavoritePlaceData_removeFavoritePlace_experiences,
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences,
|
||||
),
|
||||
]),
|
||||
() =>
|
||||
ListBuilder<
|
||||
GRemoveFavoritePlaceData_removeFavoritePlace_experiences
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places_experiences
|
||||
>(),
|
||||
)
|
||||
..addBuilderFactory(
|
||||
@@ -247,11 +262,13 @@ Serializers _$serializers =
|
||||
)
|
||||
..addBuilderFactory(
|
||||
const FullType(BuiltList, const [
|
||||
const FullType(GSearchPlacesData_searchPlaces_places_experiences),
|
||||
const FullType(
|
||||
GRemoveFavoritePlaceData_removeFavoritePlace_experiences,
|
||||
),
|
||||
]),
|
||||
() =>
|
||||
ListBuilder<
|
||||
GSearchPlacesData_searchPlaces_places_experiences
|
||||
GRemoveFavoritePlaceData_removeFavoritePlace_experiences
|
||||
>(),
|
||||
))
|
||||
.build();
|
||||
|
||||
+5
-3
@@ -1,6 +1,8 @@
|
||||
query SearchPlaces($input: SearchPlacesInput!) {
|
||||
searchPlaces(input: $input) {
|
||||
message
|
||||
mutation RecommendPlacesByVoice($input: VoicePlaceRecommendationsInput!) {
|
||||
recommendPlacesByVoice(input: $input) {
|
||||
transcript
|
||||
tags
|
||||
summary
|
||||
places {
|
||||
id
|
||||
googlePlaceId
|
||||
@@ -10,8 +10,8 @@ import 'graphql/__generated__/favorite_places.data.gql.dart';
|
||||
import 'graphql/__generated__/me.data.gql.dart';
|
||||
import 'graphql/__generated__/nearby_places.data.gql.dart';
|
||||
import 'graphql/__generated__/places.data.gql.dart';
|
||||
import 'graphql/__generated__/recommend_places_by_voice.data.gql.dart';
|
||||
import 'graphql/__generated__/remove_favorite_place.data.gql.dart';
|
||||
import 'graphql/__generated__/search_places.data.gql.dart';
|
||||
import 'graphql/__generated__/voice_experiences.data.gql.dart';
|
||||
|
||||
AppUser appUserFromMe(GMeData_me user) {
|
||||
@@ -158,8 +158,8 @@ PlaceRecommendation placeRecommendationFromFavoritePlace(
|
||||
);
|
||||
}
|
||||
|
||||
PlaceRecommendation placeRecommendationFromSearchPlace(
|
||||
GSearchPlacesData_searchPlaces_places place,
|
||||
PlaceRecommendation placeRecommendationFromVoiceRecommendedPlace(
|
||||
GRecommendPlacesByVoiceData_recommendPlacesByVoice_places place,
|
||||
) {
|
||||
return PlaceRecommendation(
|
||||
id: place.id,
|
||||
|
||||
@@ -5,8 +5,8 @@ import 'graphql/__generated__/add_favorite_place.req.gql.dart';
|
||||
import 'graphql/__generated__/favorite_places.req.gql.dart';
|
||||
import 'graphql/__generated__/nearby_places.req.gql.dart';
|
||||
import 'graphql/__generated__/places.req.gql.dart';
|
||||
import 'graphql/__generated__/recommend_places_by_voice.req.gql.dart';
|
||||
import 'graphql/__generated__/remove_favorite_place.req.gql.dart';
|
||||
import 'graphql/__generated__/search_places.req.gql.dart';
|
||||
import 'mapflow_data_mappers.dart';
|
||||
import 'mapflow_graphql_client.dart';
|
||||
|
||||
@@ -43,16 +43,23 @@ class PlacesRepository {
|
||||
return data.nearbyPlaces.map(placeRecommendationFromNearbyPlace).toList();
|
||||
}
|
||||
|
||||
Future<PlaceSearchResult> searchPlaces(String query) async {
|
||||
Future<VoicePlaceRecommendationResult> recommendPlacesByVoice({
|
||||
required String audioContentBase64,
|
||||
required String audioMimeType,
|
||||
}) async {
|
||||
final data = await _client.request(
|
||||
GSearchPlacesReq((b) {
|
||||
b.vars.input.query = query;
|
||||
GRecommendPlacesByVoiceReq((b) {
|
||||
b.vars.input
|
||||
..audioContentBase64 = audioContentBase64
|
||||
..audioMimeType = audioMimeType;
|
||||
}),
|
||||
);
|
||||
return PlaceSearchResult(
|
||||
message: data.searchPlaces.message,
|
||||
places: data.searchPlaces.places
|
||||
.map(placeRecommendationFromSearchPlace)
|
||||
return VoicePlaceRecommendationResult(
|
||||
transcript: data.recommendPlacesByVoice.transcript,
|
||||
tags: data.recommendPlacesByVoice.tags.toList().cast<String>(),
|
||||
summary: data.recommendPlacesByVoice.summary,
|
||||
places: data.recommendPlacesByVoice.places
|
||||
.map(placeRecommendationFromVoiceRecommendedPlace)
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -186,10 +186,17 @@ class PlaceRecommendation {
|
||||
}
|
||||
}
|
||||
|
||||
class PlaceSearchResult {
|
||||
const PlaceSearchResult({required this.message, required this.places});
|
||||
class VoicePlaceRecommendationResult {
|
||||
const VoicePlaceRecommendationResult({
|
||||
required this.transcript,
|
||||
required this.tags,
|
||||
required this.summary,
|
||||
required this.places,
|
||||
});
|
||||
|
||||
final String message;
|
||||
final String transcript;
|
||||
final List<String> tags;
|
||||
final String summary;
|
||||
final List<PlaceRecommendation> places;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,12 +125,12 @@ class _MapContent extends StatelessWidget {
|
||||
SafeArea(
|
||||
child: Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: _MapSearchButton(
|
||||
query: state.searchQuery,
|
||||
onSearch: placeCubit.searchPlaces,
|
||||
onClear: state.searchQuery.isEmpty
|
||||
child: _VoiceFilterButton(
|
||||
transcript: state.voiceFilterTranscript,
|
||||
onApply: placeCubit.recommendPlacesByVoice,
|
||||
onClear: state.voiceFilterTranscript.isEmpty
|
||||
? null
|
||||
: placeCubit.clearSearch,
|
||||
: placeCubit.clearVoiceFilter,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -334,21 +334,25 @@ class _AddReviewButton extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _MapSearchButton extends StatelessWidget {
|
||||
const _MapSearchButton({
|
||||
required this.query,
|
||||
required this.onSearch,
|
||||
class _VoiceFilterButton extends StatelessWidget {
|
||||
const _VoiceFilterButton({
|
||||
required this.transcript,
|
||||
required this.onApply,
|
||||
required this.onClear,
|
||||
});
|
||||
|
||||
final String query;
|
||||
final Future<void> Function(String) onSearch;
|
||||
final String transcript;
|
||||
final Future<void> Function({
|
||||
required String audioContentBase64,
|
||||
required String audioMimeType,
|
||||
})
|
||||
onApply;
|
||||
final Future<void> Function()? onClear;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tokens = context.mapflowTokens;
|
||||
final label = query.isEmpty ? 'Поиск' : query;
|
||||
final label = transcript.isEmpty ? 'Голосом' : transcript;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8, left: 70, right: 70),
|
||||
@@ -364,7 +368,7 @@ class _MapSearchButton extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const SizedBox(width: 12),
|
||||
const Icon(Icons.auto_awesome_outlined, size: 18),
|
||||
const Icon(Icons.mic_none_rounded, size: 18),
|
||||
const SizedBox(width: 8),
|
||||
Flexible(
|
||||
child: Text(
|
||||
@@ -392,40 +396,141 @@ class _MapSearchButton extends StatelessWidget {
|
||||
}
|
||||
|
||||
Future<void> _openSearch(BuildContext context) async {
|
||||
final controller = TextEditingController(text: query);
|
||||
final result = await showDialog<String>(
|
||||
final result = await showDialog<_VoiceFilterAudio>(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
contentPadding: const EdgeInsets.fromLTRB(18, 18, 18, 8),
|
||||
content: TextField(
|
||||
controller: controller,
|
||||
autofocus: true,
|
||||
textInputAction: TextInputAction.search,
|
||||
decoration: const InputDecoration(
|
||||
prefixIcon: Icon(Icons.auto_awesome_outlined),
|
||||
hintText: 'Что ищем?',
|
||||
),
|
||||
onSubmitted: (value) => Navigator.of(context).pop(value),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('Отмена'),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => Navigator.of(context).pop(controller.text),
|
||||
child: const Text('Найти'),
|
||||
),
|
||||
],
|
||||
builder: (_) => const _VoiceFilterDialog(),
|
||||
);
|
||||
},
|
||||
);
|
||||
controller.dispose();
|
||||
if (result == null) {
|
||||
return;
|
||||
}
|
||||
await onSearch(result);
|
||||
await onApply(
|
||||
audioContentBase64: result.audioContentBase64,
|
||||
audioMimeType: result.audioMimeType,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _VoiceFilterAudio {
|
||||
const _VoiceFilterAudio({
|
||||
required this.audioContentBase64,
|
||||
required this.audioMimeType,
|
||||
});
|
||||
|
||||
final String audioContentBase64;
|
||||
final String audioMimeType;
|
||||
}
|
||||
|
||||
class _VoiceFilterDialog extends StatefulWidget {
|
||||
const _VoiceFilterDialog();
|
||||
|
||||
@override
|
||||
State<_VoiceFilterDialog> createState() => _VoiceFilterDialogState();
|
||||
}
|
||||
|
||||
class _VoiceFilterDialogState extends State<_VoiceFilterDialog> {
|
||||
final _waveController = WaveformRecorderController(
|
||||
interval: const Duration(milliseconds: 60),
|
||||
config: const RecordConfig(
|
||||
numChannels: 1,
|
||||
sampleRate: 44100,
|
||||
autoGain: true,
|
||||
echoCancel: true,
|
||||
noiseSuppress: true,
|
||||
),
|
||||
);
|
||||
|
||||
var _recording = false;
|
||||
var _submitting = false;
|
||||
var _hasRecording = false;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_waveController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _toggleRecording() async {
|
||||
if (_recording) {
|
||||
await _waveController.stopRecording();
|
||||
setState(() {
|
||||
_recording = false;
|
||||
_hasRecording = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await _waveController.startRecording();
|
||||
setState(() => _recording = true);
|
||||
}
|
||||
|
||||
Future<void> _apply() async {
|
||||
if (_recording) {
|
||||
await _waveController.stopRecording();
|
||||
setState(() {
|
||||
_recording = false;
|
||||
_hasRecording = true;
|
||||
});
|
||||
}
|
||||
final file = _waveController.file;
|
||||
if (file == null) {
|
||||
throw StateError('Voice filter recording file is required.');
|
||||
}
|
||||
setState(() => _submitting = true);
|
||||
final bytes = await file.readAsBytes();
|
||||
if (!mounted) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pop(
|
||||
_VoiceFilterAudio(
|
||||
audioContentBase64: base64Encode(bytes),
|
||||
audioMimeType: file.mimeType ?? 'audio/wav',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
contentPadding: const EdgeInsets.fromLTRB(18, 18, 18, 8),
|
||||
content: SizedBox(
|
||||
width: 260,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton.filled(
|
||||
onPressed: _submitting ? null : _toggleRecording,
|
||||
icon: Icon(_recording ? Icons.stop_rounded : Icons.mic_rounded),
|
||||
iconSize: 34,
|
||||
style: IconButton.styleFrom(
|
||||
fixedSize: const Size.square(82),
|
||||
minimumSize: const Size.square(82),
|
||||
),
|
||||
tooltip: _recording ? 'Стоп' : 'Записать',
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
_recording ? 'Слушаю' : 'Голосовой фильтр',
|
||||
style: const TextStyle(fontWeight: FontWeight.w900),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: _submitting ? null : () => Navigator.of(context).pop(),
|
||||
child: const Text('Отмена'),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: _submitting || !_hasRecording ? null : _apply,
|
||||
child: _submitting
|
||||
? const SizedBox.square(
|
||||
dimension: 18,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Text('Применить'),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user