From 057c78c01e3d3859db4fdf9c2b23317c828fa0f0 Mon Sep 17 00:00:00 2001 From: Axel LE BOT Date: Fri, 26 Jul 2019 15:55:24 +0200 Subject: [PATCH] [TASK] Renamed generic data model - Deleted old unused secret file --- lib/src/data/models/api_models.dart | 8 ++++---- lib/src/data/models/api_models.g.dart | 8 ++++---- secrets.json.dist | 4 ---- 3 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 secrets.json.dist diff --git a/lib/src/data/models/api_models.dart b/lib/src/data/models/api_models.dart index a48e302..494393f 100644 --- a/lib/src/data/models/api_models.dart +++ b/lib/src/data/models/api_models.dart @@ -166,7 +166,7 @@ abstract class _Envelop { @JsonSerializable() class DataEnvelop extends _Envelop { - @_GenericListConverter() + @_GenericConverter() T data; DataEnvelop({ @@ -183,7 +183,7 @@ class DataEnvelop extends _Envelop { @JsonSerializable() class DataArrayEnvelop extends _Envelop { - @_GenericListConverter() + @_GenericConverter() List data; int total; @@ -203,8 +203,8 @@ class DataArrayEnvelop extends _Envelop { /// Example of model with GenericCollection /// https://github.com/dart-lang/json_serializable/blob/ee2c5c788279af01860624303abe16811850b82c/example/lib/json_converter_example.dart -class _GenericListConverter implements JsonConverter { - const _GenericListConverter(); +class _GenericConverter implements JsonConverter { + const _GenericConverter(); @override T fromJson(Object json) { diff --git a/lib/src/data/models/api_models.g.dart b/lib/src/data/models/api_models.g.dart index a312f22..b165a7f 100644 --- a/lib/src/data/models/api_models.g.dart +++ b/lib/src/data/models/api_models.g.dart @@ -87,7 +87,7 @@ DataEnvelop _$DataEnvelopFromJson(Map json) { message: json['message'] as String, data: json['data'] == null ? null - : _GenericListConverter().fromJson(json['data'])); + : _GenericConverter().fromJson(json['data'])); } Map _$DataEnvelopToJson(DataEnvelop instance) => @@ -96,7 +96,7 @@ Map _$DataEnvelopToJson(DataEnvelop instance) => 'message': instance.message, 'data': instance.data == null ? null - : _GenericListConverter().toJson(instance.data) + : _GenericConverter().toJson(instance.data) }; DataArrayEnvelop _$DataArrayEnvelopFromJson(Map json) { @@ -105,7 +105,7 @@ DataArrayEnvelop _$DataArrayEnvelopFromJson(Map json) { message: json['message'] as String, data: (json['data'] as List) ?.map( - (e) => e == null ? null : _GenericListConverter().fromJson(e)) + (e) => e == null ? null : _GenericConverter().fromJson(e)) ?.toList(), total: json['total'] as int); } @@ -116,7 +116,7 @@ Map _$DataArrayEnvelopToJson( 'error': instance.error, 'message': instance.message, 'data': instance.data - ?.map((e) => e == null ? null : _GenericListConverter().toJson(e)) + ?.map((e) => e == null ? null : _GenericConverter().toJson(e)) ?.toList(), 'total': instance.total }; diff --git a/secrets.json.dist b/secrets.json.dist deleted file mode 100644 index 5e97524..0000000 --- a/secrets.json.dist +++ /dev/null @@ -1,4 +0,0 @@ -{ - "clientId": "", - "clientSecret": "" -} \ No newline at end of file