From 11be125dbbca9eba2c39a39bd911878e146d0954 Mon Sep 17 00:00:00 2001 From: Lejard Hadrien Date: Sat, 16 Feb 2019 15:04:18 +0100 Subject: [PATCH] format --- chopper/lib/src/base.dart | 2 +- example/bin/main_built_value.dart | 1 + example/lib/built_value_serializers.dart | 2 +- example/lib/jaguar_serializer.dart | 2 +- example/lib/json_serializable.dart | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/chopper/lib/src/base.dart b/chopper/lib/src/base.dart index bd19d343..4f10d72b 100644 --- a/chopper/lib/src/base.dart +++ b/chopper/lib/src/base.dart @@ -89,7 +89,7 @@ class ChopperClient { if (withConverter == null) return response; final converted = await withConverter.convertResponse(response); - + if (converted == null) { throw Exception("No converter found for type $ToDecode"); } diff --git a/example/bin/main_built_value.dart b/example/bin/main_built_value.dart index 76eddc53..6a7c9048 100644 --- a/example/bin/main_built_value.dart +++ b/example/bin/main_built_value.dart @@ -64,6 +64,7 @@ class BuiltValueConverter extends JsonConverter { dynamic _decode(entity) { print(entity); print(entity.runtimeType); + /// handle case when we want to access to Map directly /// getResource or getMapResource /// Avoid dynamic or unconverted value, this could lead to several issues diff --git a/example/lib/built_value_serializers.dart b/example/lib/built_value_serializers.dart index aa2e7788..cc8ef450 100644 --- a/example/lib/built_value_serializers.dart +++ b/example/lib/built_value_serializers.dart @@ -10,4 +10,4 @@ part 'built_value_serializers.g.dart'; Resource, ResourceError, ]) -final Serializers serializers = _$serializers; \ No newline at end of file +final Serializers serializers = _$serializers; diff --git a/example/lib/jaguar_serializer.dart b/example/lib/jaguar_serializer.dart index c3f78a78..f0bdbfd1 100644 --- a/example/lib/jaguar_serializer.dart +++ b/example/lib/jaguar_serializer.dart @@ -42,4 +42,4 @@ abstract class MyService extends ChopperService { @Post() Future> newResource(@Body() Resource resource, {@Header() String name}); -} \ No newline at end of file +} diff --git a/example/lib/json_serializable.dart b/example/lib/json_serializable.dart index f0fe8373..aafeb9ea 100644 --- a/example/lib/json_serializable.dart +++ b/example/lib/json_serializable.dart @@ -44,4 +44,4 @@ abstract class MyService extends ChopperService { @Post() Future> newResource(@Body() Resource resource, {@Header() String name}); -} \ No newline at end of file +}