diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/add_director_to_movie.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/add_director_to_movie.dart index 85ac837cd7e8..380b4492b1a1 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/add_director_to_movie.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/add_director_to_movie.dart @@ -1,292 +1,132 @@ part of movies; - - - - - - class AddDirectorToMovie { String name = "addDirectorToMovie"; AddDirectorToMovie({required this.dataConnect}); - Deserializer dataDeserializer = (String json) => AddDirectorToMovieResponse.fromJson(jsonDecode(json) as Map); - Serializer varsSerializer = (AddDirectorToMovieVariables vars) => jsonEncode(vars.toJson()); - MutationRef ref( - {AddDirectorToMovieVariablesPersonId? personId,String? movieId,}) { - AddDirectorToMovieVariables vars=AddDirectorToMovieVariables(personId: personId,movieId: movieId,); - - return dataConnect.mutation(this.name, dataDeserializer, varsSerializer, vars); + Deserializer dataDeserializer = (String json) => + AddDirectorToMovieResponse.fromJson( + jsonDecode(json) as Map); + Serializer varsSerializer = + (AddDirectorToMovieVariables vars) => jsonEncode(vars.toJson()); + MutationRef ref({ + AddDirectorToMovieVariablesPersonId? personId, + String? movieId, + }) { + AddDirectorToMovieVariables vars = AddDirectorToMovieVariables( + personId: personId, + movieId: movieId, + ); + + return dataConnect.mutation( + this.name, dataDeserializer, varsSerializer, vars); } + FirebaseDataConnect dataConnect; } - - - - class AddDirectorToMovieDirectedByInsert { - - - - - late String directedbyId; - - - - - - late String movieId; - - - - AddDirectorToMovieDirectedByInsert.fromJson(Map json): - directedbyId = - json['directedbyId'], - - - movieId = - json['movieId'] - - { - - - - - - } + late String directedbyId; + + late String movieId; + AddDirectorToMovieDirectedByInsert.fromJson(Map json) + : directedbyId = json['directedbyId'], + movieId = json['movieId'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['directedbyId'] = - - directedbyId - -; - - - - json['movieId'] = - - movieId - -; - - + + json['directedbyId'] = directedbyId; + + json['movieId'] = movieId; + return json; } AddDirectorToMovieDirectedByInsert({ - required this.directedbyId, - required this.movieId, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class AddDirectorToMovieResponse { - - - - - late AddDirectorToMovieDirectedByInsert directedBy_insert; - - - - AddDirectorToMovieResponse.fromJson(Map json): - directedBy_insert = - AddDirectorToMovieDirectedByInsert.fromJson(json['directedBy_insert']) - - - { - - - - } + late AddDirectorToMovieDirectedByInsert directedBy_insert; + AddDirectorToMovieResponse.fromJson(Map json) + : directedBy_insert = AddDirectorToMovieDirectedByInsert.fromJson( + json['directedBy_insert']) {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['directedBy_insert'] = - - directedBy_insert.toJson() - -; - - + + json['directedBy_insert'] = directedBy_insert.toJson(); + return json; } AddDirectorToMovieResponse({ - required this.directedBy_insert, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class AddDirectorToMovieVariablesPersonId { - - - - - late String id; - - - - AddDirectorToMovieVariablesPersonId.fromJson(Map json): - id = - json['id'] - - { - - - - } + late String id; + AddDirectorToMovieVariablesPersonId.fromJson(Map json) + : id = json['id'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['id'] = - - id - -; - - + + json['id'] = id; + return json; } AddDirectorToMovieVariablesPersonId({ - required this.id, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } +class AddDirectorToMovieVariables { + late AddDirectorToMovieVariablesPersonId? personId; + late String? movieId; + AddDirectorToMovieVariables.fromJson(Map json) + : personId = + AddDirectorToMovieVariablesPersonId.fromJson(json['personId']), + movieId = json['movieId'] {} - - + // TODO(mtewani): Fix up to create a map on the fly + Map toJson() { + Map json = {}; -class AddDirectorToMovieVariables { - - - - - late AddDirectorToMovieVariablesPersonId? personId; - - - - - - late String? movieId; - - - - AddDirectorToMovieVariables.fromJson(Map json): - personId = - AddDirectorToMovieVariablesPersonId.fromJson(json['personId']) - , - - - movieId = - json['movieId'] - - { - - - - - + if (personId != null) { + json['personId'] = personId!.toJson(); } + if (movieId != null) { + json['movieId'] = movieId; + } - // TODO(mtewani): Fix up to create a map on the fly - Map toJson() { - Map json = {}; - - - if (personId != null) { - json['personId'] = - - personId!.toJson() - -; - } - - - - if (movieId != null) { - json['movieId'] = - - movieId - -; - } - - return json; } AddDirectorToMovieVariables({ - - this.personId, - - this.movieId, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - - - + this.personId, + this.movieId, + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/add_person.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/add_person.dart index ed2fae00f6e1..1627b3691fc7 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/add_person.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/add_person.dart @@ -1,188 +1,90 @@ part of movies; - - - - - - class AddPerson { String name = "addPerson"; AddPerson({required this.dataConnect}); - Deserializer dataDeserializer = (String json) => AddPersonResponse.fromJson(jsonDecode(json) as Map); - Serializer varsSerializer = (AddPersonVariables vars) => jsonEncode(vars.toJson()); - MutationRef ref( - {String? name,}) { - AddPersonVariables vars=AddPersonVariables(name: name,); - - return dataConnect.mutation(this.name, dataDeserializer, varsSerializer, vars); + Deserializer dataDeserializer = (String json) => + AddPersonResponse.fromJson(jsonDecode(json) as Map); + Serializer varsSerializer = + (AddPersonVariables vars) => jsonEncode(vars.toJson()); + MutationRef ref({ + String? name, + }) { + AddPersonVariables vars = AddPersonVariables( + name: name, + ); + + return dataConnect.mutation( + this.name, dataDeserializer, varsSerializer, vars); } + FirebaseDataConnect dataConnect; } - - - - class AddPersonPersonInsert { - - - - - late String id; - - - - AddPersonPersonInsert.fromJson(Map json): - id = - json['id'] - - { - - - - } + late String id; + AddPersonPersonInsert.fromJson(Map json) : id = json['id'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['id'] = - - id - -; - - + + json['id'] = id; + return json; } AddPersonPersonInsert({ - required this.id, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class AddPersonResponse { - - - - - late AddPersonPersonInsert person_insert; - - - - AddPersonResponse.fromJson(Map json): - person_insert = - AddPersonPersonInsert.fromJson(json['person_insert']) - - - { - - - - } + late AddPersonPersonInsert person_insert; + AddPersonResponse.fromJson(Map json) + : person_insert = AddPersonPersonInsert.fromJson(json['person_insert']) {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['person_insert'] = - - person_insert.toJson() - -; - - + + json['person_insert'] = person_insert.toJson(); + return json; } AddPersonResponse({ - required this.person_insert, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class AddPersonVariables { - - - - - late String? name; - - - - AddPersonVariables.fromJson(Map json): - name = - json['name'] - - { - - - - } + late String? name; + AddPersonVariables.fromJson(Map json) + : name = json['name'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - if (name != null) { - json['name'] = - - name - -; - } - - + + if (name != null) { + json['name'] = name; + } + return json; } AddPersonVariables({ - - this.name, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + this.name, + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/create_movie.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/create_movie.dart index 639846c508d9..a5c3db631aa7 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/create_movie.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/create_movie.dart @@ -1,286 +1,125 @@ part of movies; - - - - - - class CreateMovie { String name = "createMovie"; CreateMovie({required this.dataConnect}); - Deserializer dataDeserializer = (String json) => CreateMovieResponse.fromJson(jsonDecode(json) as Map); - Serializer varsSerializer = (CreateMovieVariables vars) => jsonEncode(vars.toJson()); - MutationRef ref( - {required String title,required int releaseYear,required String genre,double? rating,String? description,}) { - CreateMovieVariables vars=CreateMovieVariables(title: title,releaseYear: releaseYear,genre: genre,rating: rating,description: description,); - - return dataConnect.mutation(this.name, dataDeserializer, varsSerializer, vars); + Deserializer dataDeserializer = (String json) => + CreateMovieResponse.fromJson(jsonDecode(json) as Map); + Serializer varsSerializer = + (CreateMovieVariables vars) => jsonEncode(vars.toJson()); + MutationRef ref({ + required String title, + required int releaseYear, + required String genre, + double? rating, + String? description, + }) { + CreateMovieVariables vars = CreateMovieVariables( + title: title, + releaseYear: releaseYear, + genre: genre, + rating: rating, + description: description, + ); + + return dataConnect.mutation( + this.name, dataDeserializer, varsSerializer, vars); } + FirebaseDataConnect dataConnect; } - - - - class CreateMovieMovieInsert { - - - - - late String id; - - - - CreateMovieMovieInsert.fromJson(Map json): - id = - json['id'] - - { - - - - } + late String id; + CreateMovieMovieInsert.fromJson(Map json) + : id = json['id'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['id'] = - - id - -; - - + + json['id'] = id; + return json; } CreateMovieMovieInsert({ - required this.id, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class CreateMovieResponse { - - - - - late CreateMovieMovieInsert movie_insert; - - - - CreateMovieResponse.fromJson(Map json): - movie_insert = - CreateMovieMovieInsert.fromJson(json['movie_insert']) - - - { - - - - } + late CreateMovieMovieInsert movie_insert; + CreateMovieResponse.fromJson(Map json) + : movie_insert = CreateMovieMovieInsert.fromJson(json['movie_insert']) {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['movie_insert'] = - - movie_insert.toJson() - -; - - + + json['movie_insert'] = movie_insert.toJson(); + return json; } CreateMovieResponse({ - required this.movie_insert, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } +class CreateMovieVariables { + late String title; + late int releaseYear; + late String genre; - - + late double? rating; -class CreateMovieVariables { - - - - - late String title; - - - - - - late int releaseYear; - - - - - - late String genre; - - - - - - late double? rating; - - - - - - late String? description; - - - - CreateMovieVariables.fromJson(Map json): - title = - json['title'], - - - releaseYear = - json['releaseYear'], - - - genre = - json['genre'], - - - rating = - json['rating'], - - - description = - json['description'] - - { - - - - - - - - - - - - } + late String? description; + CreateMovieVariables.fromJson(Map json) + : title = json['title'], + releaseYear = json['releaseYear'], + genre = json['genre'], + rating = json['rating'], + description = json['description'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['title'] = - - title - -; - - - - json['releaseYear'] = - - releaseYear - -; - - - - json['genre'] = - - genre - -; - - - - if (rating != null) { - json['rating'] = - - rating - -; - } - - - - if (description != null) { - json['description'] = - - description - -; - } - - + + json['title'] = title; + + json['releaseYear'] = releaseYear; + + json['genre'] = genre; + + if (rating != null) { + json['rating'] = rating; + } + + if (description != null) { + json['description'] = description; + } + return json; } CreateMovieVariables({ - required this.title, - required this.releaseYear, - required this.genre, - - this.rating, - - this.description, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - - - - - - - - - + this.rating, + this.description, + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/delete_movie.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/delete_movie.dart index 680a64a06b5a..e56a96f32cee 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/delete_movie.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/delete_movie.dart @@ -1,188 +1,90 @@ part of movies; - - - - - - class DeleteMovie { String name = "deleteMovie"; DeleteMovie({required this.dataConnect}); - Deserializer dataDeserializer = (String json) => DeleteMovieResponse.fromJson(jsonDecode(json) as Map); - Serializer varsSerializer = (DeleteMovieVariables vars) => jsonEncode(vars.toJson()); - MutationRef ref( - {required String id,}) { - DeleteMovieVariables vars=DeleteMovieVariables(id: id,); - - return dataConnect.mutation(this.name, dataDeserializer, varsSerializer, vars); + Deserializer dataDeserializer = (String json) => + DeleteMovieResponse.fromJson(jsonDecode(json) as Map); + Serializer varsSerializer = + (DeleteMovieVariables vars) => jsonEncode(vars.toJson()); + MutationRef ref({ + required String id, + }) { + DeleteMovieVariables vars = DeleteMovieVariables( + id: id, + ); + + return dataConnect.mutation( + this.name, dataDeserializer, varsSerializer, vars); } + FirebaseDataConnect dataConnect; } - - - - class DeleteMovieMovieDelete { - - - - - late String id; - - - - DeleteMovieMovieDelete.fromJson(Map json): - id = - json['id'] - - { - - - - } + late String id; + DeleteMovieMovieDelete.fromJson(Map json) + : id = json['id'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['id'] = - - id - -; - - + + json['id'] = id; + return json; } DeleteMovieMovieDelete({ - required this.id, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class DeleteMovieResponse { - - - - - late DeleteMovieMovieDelete? movie_delete; - - - - DeleteMovieResponse.fromJson(Map json): - movie_delete = - DeleteMovieMovieDelete.fromJson(json['movie_delete']) - - - { - - - - } + late DeleteMovieMovieDelete? movie_delete; + DeleteMovieResponse.fromJson(Map json) + : movie_delete = DeleteMovieMovieDelete.fromJson(json['movie_delete']) {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - if (movie_delete != null) { - json['movie_delete'] = - - movie_delete!.toJson() - -; - } - - + + if (movie_delete != null) { + json['movie_delete'] = movie_delete!.toJson(); + } + return json; } DeleteMovieResponse({ - - this.movie_delete, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + this.movie_delete, + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class DeleteMovieVariables { - - - - - late String id; - - - - DeleteMovieVariables.fromJson(Map json): - id = - json['id'] - - { - - - - } + late String id; + DeleteMovieVariables.fromJson(Map json) : id = json['id'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['id'] = - - id - -; - - + + json['id'] = id; + return json; } DeleteMovieVariables({ - required this.id, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_movies.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_movies.dart index 379222318f3a..58e13493a23e 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_movies.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_movies.dart @@ -1,238 +1,97 @@ part of movies; - - - - - - class ListMovies { String name = "ListMovies"; ListMovies({required this.dataConnect}); - Deserializer dataDeserializer = (String json) => ListMoviesResponse.fromJson(jsonDecode(json) as Map); - - QueryRef ref( - ) { - + Deserializer dataDeserializer = (String json) => + ListMoviesResponse.fromJson(jsonDecode(json) as Map); + + QueryRef ref() { return dataConnect.query(this.name, dataDeserializer, null, null); } + FirebaseDataConnect dataConnect; } +class ListMoviesMovies { + late String id; - + late String title; + late List directed_by; -class ListMoviesMovies { - - - - - late String id; - - - - - - late String title; - - - - - - late List directed_by; - - - - ListMoviesMovies.fromJson(Map json): - id = - json['id'], - - - title = - json['title'], - - - directed_by = - (json['directed_by'] as List) - .map((e) => ListMoviesMoviesDirectedBy.fromJson(e)) - .toList() - - - { - - - - - - - - } - + ListMoviesMovies.fromJson(Map json) + : id = json['id'], + title = json['title'], + directed_by = (json['directed_by'] as List) + .map((e) => ListMoviesMoviesDirectedBy.fromJson(e)) + .toList() {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['id'] = - - id - -; - - - - json['title'] = - - title - -; - - - - json['directed_by'] = - - directed_by.map((e) => e.toJson()).toList() - -; - - + + json['id'] = id; + + json['title'] = title; + + json['directed_by'] = directed_by.map((e) => e.toJson()).toList(); + return json; } ListMoviesMovies({ - required this.id, - required this.title, - required this.directed_by, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - - - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class ListMoviesMoviesDirectedBy { - - - - - late String name; - - - - ListMoviesMoviesDirectedBy.fromJson(Map json): - name = - json['name'] - - { - - - - } + late String name; + ListMoviesMoviesDirectedBy.fromJson(Map json) + : name = json['name'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['name'] = - - name - -; - - + + json['name'] = name; + return json; } ListMoviesMoviesDirectedBy({ - required this.name, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class ListMoviesResponse { - - - - - late List movies; - - - - ListMoviesResponse.fromJson(Map json): - movies = - (json['movies'] as List) - .map((e) => ListMoviesMovies.fromJson(e)) - .toList() - - - { - - - - } + late List movies; + ListMoviesResponse.fromJson(Map json) + : movies = (json['movies'] as List) + .map((e) => ListMoviesMovies.fromJson(e)) + .toList() {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['movies'] = - - movies.map((e) => e.toJson()).toList() - -; - - + + json['movies'] = movies.map((e) => e.toJson()).toList(); + return json; } ListMoviesResponse({ - required this.movies, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_movies_by_partial_title.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_movies_by_partial_title.dart index 55e98a30d3df..3304930622ba 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_movies_by_partial_title.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_movies_by_partial_title.dart @@ -1,262 +1,112 @@ part of movies; - - - - - - class ListMoviesByPartialTitle { String name = "ListMoviesByPartialTitle"; ListMoviesByPartialTitle({required this.dataConnect}); - Deserializer dataDeserializer = (String json) => ListMoviesByPartialTitleResponse.fromJson(jsonDecode(json) as Map); - Serializer varsSerializer = (ListMoviesByPartialTitleVariables vars) => jsonEncode(vars.toJson()); - QueryRef ref( - {required String input,}) { - ListMoviesByPartialTitleVariables vars=ListMoviesByPartialTitleVariables(input: input,); + Deserializer dataDeserializer = + (String json) => ListMoviesByPartialTitleResponse.fromJson( + jsonDecode(json) as Map); + Serializer varsSerializer = + (ListMoviesByPartialTitleVariables vars) => jsonEncode(vars.toJson()); + QueryRef + ref({ + required String input, + }) { + ListMoviesByPartialTitleVariables vars = ListMoviesByPartialTitleVariables( + input: input, + ); return dataConnect.query(this.name, dataDeserializer, varsSerializer, vars); } + FirebaseDataConnect dataConnect; } +class ListMoviesByPartialTitleMovies { + late String id; - + late String title; + late String genre; -class ListMoviesByPartialTitleMovies { - - - - - late String id; - - - - - - late String title; - - - - - - late String genre; - - - - - - late double? rating; - - - - ListMoviesByPartialTitleMovies.fromJson(Map json): - id = - json['id'], - - - title = - json['title'], - - - genre = - json['genre'], - - - rating = - json['rating'] - - { - - - - - - - - - - } + late double? rating; + ListMoviesByPartialTitleMovies.fromJson(Map json) + : id = json['id'], + title = json['title'], + genre = json['genre'], + rating = json['rating'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['id'] = - - id - -; - - - - json['title'] = - - title - -; - - - - json['genre'] = - - genre - -; - - - - if (rating != null) { - json['rating'] = - - rating - -; - } - - + + json['id'] = id; + + json['title'] = title; + + json['genre'] = genre; + + if (rating != null) { + json['rating'] = rating; + } + return json; } ListMoviesByPartialTitleMovies({ - required this.id, - required this.title, - required this.genre, - - this.rating, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - - - - - - - + this.rating, + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class ListMoviesByPartialTitleResponse { - - - - - late List movies; - - - - ListMoviesByPartialTitleResponse.fromJson(Map json): - movies = - (json['movies'] as List) - .map((e) => ListMoviesByPartialTitleMovies.fromJson(e)) - .toList() - - - { - - - - } + late List movies; + ListMoviesByPartialTitleResponse.fromJson(Map json) + : movies = (json['movies'] as List) + .map((e) => ListMoviesByPartialTitleMovies.fromJson(e)) + .toList() {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['movies'] = - - movies.map((e) => e.toJson()).toList() - -; - - + + json['movies'] = movies.map((e) => e.toJson()).toList(); + return json; } ListMoviesByPartialTitleResponse({ - required this.movies, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class ListMoviesByPartialTitleVariables { - - - - - late String input; - - - - ListMoviesByPartialTitleVariables.fromJson(Map json): - input = - json['input'] - - { - - - - } + late String input; + ListMoviesByPartialTitleVariables.fromJson(Map json) + : input = json['input'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['input'] = - - input - -; - - + + json['input'] = input; + return json; } ListMoviesByPartialTitleVariables({ - required this.input, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_persons.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_persons.dart index a30fc82c5acb..8a4d7e4cb0a6 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_persons.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/list_persons.dart @@ -1,158 +1,67 @@ part of movies; - - - - - - class ListPersons { String name = "ListPersons"; ListPersons({required this.dataConnect}); - Deserializer dataDeserializer = (String json) => ListPersonsResponse.fromJson(jsonDecode(json) as Map); - - QueryRef ref( - ) { - + Deserializer dataDeserializer = (String json) => + ListPersonsResponse.fromJson(jsonDecode(json) as Map); + + QueryRef ref() { return dataConnect.query(this.name, dataDeserializer, null, null); } + FirebaseDataConnect dataConnect; } - - - - class ListPersonsPeople { - - - - - late String id; - - - - - - late String name; - - - - ListPersonsPeople.fromJson(Map json): - id = - json['id'], - - - name = - json['name'] - - { - - - - - - } + late String id; + + late String name; + ListPersonsPeople.fromJson(Map json) + : id = json['id'], + name = json['name'] {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['id'] = - - id - -; - - - - json['name'] = - - name - -; - - + + json['id'] = id; + + json['name'] = name; + return json; } ListPersonsPeople({ - required this.id, - required this.name, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - class ListPersonsResponse { - - - - - late List people; - - - - ListPersonsResponse.fromJson(Map json): - people = - (json['people'] as List) - .map((e) => ListPersonsPeople.fromJson(e)) - .toList() - - - { - - - - } + late List people; + ListPersonsResponse.fromJson(Map json) + : people = (json['people'] as List) + .map((e) => ListPersonsPeople.fromJson(e)) + .toList() {} // TODO(mtewani): Fix up to create a map on the fly Map toJson() { Map json = {}; - - - json['people'] = - - people.map((e) => e.toJson()).toList() - -; - - + + json['people'] = people.map((e) => e.toJson()).toList(); + return json; } ListPersonsResponse({ - required this.people, - - }) { // TODO(mtewani): Only show this if there are optional fields. - - - + }) { + // TODO(mtewani): Only show this if there are optional fields. } - } - - - - - - diff --git a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/movies.dart b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/movies.dart index 21d1b89a536c..1c40ee434bb3 100644 --- a/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/movies.dart +++ b/packages/firebase_data_connect/firebase_data_connect/example/lib/generated/movies.dart @@ -1,4 +1,5 @@ library movies; + import 'package:firebase_data_connect/firebase_data_connect.dart'; import 'dart:convert'; @@ -18,42 +19,38 @@ part 'list_movies_by_partial_title.dart'; part 'list_persons.dart'; - - class MoviesConnector { - AddPerson get addPerson { return AddPerson(dataConnect: dataConnect); } - + AddDirectorToMovie get addDirectorToMovie { return AddDirectorToMovie(dataConnect: dataConnect); } - + SeedMovies get seedMovies { return SeedMovies(dataConnect: dataConnect); } - + CreateMovie get createMovie { return CreateMovie(dataConnect: dataConnect); } - + DeleteMovie get deleteMovie { return DeleteMovie(dataConnect: dataConnect); } - + ListMovies get listMovies { return ListMovies(dataConnect: dataConnect); } - + ListMoviesByPartialTitle get listMoviesByPartialTitle { return ListMoviesByPartialTitle(dataConnect: dataConnect); } - + ListPersons get listPersons { return ListPersons(dataConnect: dataConnect); } - static ConnectorConfig connectorConfig = ConnectorConfig( 'us-west2', @@ -70,4 +67,3 @@ class MoviesConnector { FirebaseDataConnect dataConnect; } -