Chopper (Retrofit for Flutter) #3 – Converters & Built Value Integration - Dart HTTP Client Tutorial

preview_player
Показать описание
📗 Learn from the written tutorial & GET THE CODE 👇👇

👨‍💻 Do you write good code? Find out now 👇

You now know almost all the things Chopper has to offer which you'll need on a daily basis. Sending requests, obtaining responses, adding interceptors... There's only one thing missing which will plug a hole in a clean coder's heart - type safety.

JSON itself is not typesafe, we'll have to live with it. However, we can make our code a lot more readable and less error prone if we ditch dynamic data for a real data type. Chopper offers an amazing way to convert request and response data with the help of a library of your own choice. Our choice for for this tutorial will be built_value.

Built Value is arguably the best choice when you want to create immutable data classes (with all the bells and whistles like copying and value equality) AND on top of that, it has a first-class JSON serialization support.

Go to the website for more information, code examples, and articles:

Follow me on social media:
Рекомендации по теме
Комментарии
Автор

This is a really good tutorial, a lot of useful information. Thanks!

viniciustozzi
Автор

hi, thanks for the tutorial but this seems lots of code compare to native android Retrofit library but there is retrofit library for flutter as well. Can you make video on that as well.

arindomghosh
Автор

Hi, Reso Coder, how do we mix chopper, built_value, flutter_bloc all together?

saguoran
Автор

Very informative and well done, if you want to see other great 12 volt videos Thank you for the content

cruxinterfaces
Автор

type _$BuiltPost is not a subtype of type BuiltList<Post> i am having this error

phanindravarma
Автор

Hello Matej. Thank you for your valuable content! At least for me, the link provided to your well detailed and explained blog for this topic of the Chopper series returns a "404" error page. Again, thank you for your time.

phutchins
Автор

How can i use freezed instead of built value?? Thanks

AkashSingh-crly
Автор

Any comment from you For Chopper vs Dio?

mohammadmujahid
Автор

Hi :) First of all, I'd like to thank you for all your videos. And also, I'd like to know how do you find all this amazing libraries like Chopper and Moor, I'm starting to use flutter and I don't really know where to find good libraries. Thank you very much and keep doing this awesome videos.

louisphillipedubois
Автор

why not json_serializable instead of build_value ?

sarinupreti
Автор

How one can mock an http response for unit test in order to i.e. check if converter works ok?

appCowboys
Автор

What is the best way for multiple blocs in this architecture?

olegshishkov
Автор

Honestly I cannot find a reason to run built_value over json_serializable for type safe JSON

LukePighetti
Автор

Hi, thanks a lot for this valuable tutorial. I have a doubt, how to deserialize multiple model in built_value_converter.dart. Sorry if i asked a very basic question, but I'am a beginner.

dennissamual
Автор

The doesnt work for me. It tells me, that a Serializer<dynamic> cannot be assignet to a Serializer<Object>. I even copy and pasted your code, but its not possible for me to get it working. Any ideas?

vlz_krypton
Автор

i tried to implement your code im getting error in built_value_converter.dart that request.replace error

deepakv
Автор

Hi! Converter part is just awesome! Is your converter code applicable to a more complicated nested json data too?

임창수-cc
Автор

Thank you for the video, I have a request. I am an android developer now i am going to try flutter. I was using retrofit in android. I Search for it in pub.dev and found their is a retrofit for flutter also. Can you please make a video on this also please. Thank you very much.

sayyedaamer
Автор

Hi with your tutorial i have completely worked it out in my project. Investing time on learning your tutorial is really worth it. If you have some extra time can you let us know how to use "convertError" in built value converter when we get json error response from API. I used your convertResponse code and it gives me
LoginResponseModel {
status=Unauthorized,
message=Invalid Username !,
}
but i am unable to get the error message as response.error.message without using json.decode.


Once again thank you very much for this tutorial, it is really really useful. I m planning on watching all your videos in your sight this Christmas holiday.

dennisr
Автор

Some things make me a little confusing

joonseong