Chopper (Retrofit for Flutter) - #1 Basics - Dart HTTP Client Generator Tutorial

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

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

Working with RESTful APIs and making HTTP requests is the bread and butter of almost every developer. If you're coming from Android, you probably know about Retrofit. iOS developers, as I'm told, have the Alamofire library.

On Flutter though, you usually use the http package or something like dio. Although these packages do an awesome job, they still leave you working at the lowest level. The question arises - what can we, Flutter developers, use to simplify our work with HTTP APIs? Chopper!

Chopper is a library which, besides other things, generates code to simplify the development process for us. In addition to Chopper itself, we are going to use the Provider package to make InheritedWidget syntax simple.

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

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

U know what we expect without asking. Thanks for another great tutorial👏

sudesh
Автор

All i can say is

This Guy Is Awesome!!!

no pasting of codes gotten from God knows where. So Nice

Fybuh
Автор

One of the best tutorial on YouTube about Chopper. Thank you for your handwork for us and we all appreciate your kindness. Thank you.

nbits
Автор

If you have problem this row: builder: (_) => PostApiService.create(),
replace 'builder' with 'create': create: (_) => PostApiService.create(),
It's all because of the 4th version of provider (Reso coder uses 3rd version in his video)

nazar.kk
Автор

Hi Matt, again awesome video series! Well Done! I would really appreciate a Part 4 about Authentication and Headers :)

alexzehet
Автор

Could you show how to use 2 or more ChopperServices within the same ChopperClient? I'd like to have a custom converter for each of the ChopperServices.

bartekpacia
Автор

Is Chopper in your opinion any better than Dio? I haven't used Dio but it has way more stars.

appCowboys
Автор

Thanks a lot for tutorial. But I have a question. How to provide ApiService using flutter_bloc and bloc lib? is it possible? and how to dispose it?

KenanYusubov
Автор

I have been following you in kotlin tuts, now i am happy that you also decided to use flutter as i do, we need another video of dealing with chopper while posting data, when is it coming out?

uweopfern
Автор

We don't know which way to go with Android Development these days. Java, Kotlin, Flutter. Also google hacking together stupid libraries like the Paging library (which is a complete mess) does not help at all. What is your recommendation?

stcojo
Автор

How to send multipart request wilt multiple values like image and strings etc, please ?

husseinkamal
Автор

why does not put any example on multipart requests?

bedellemotio
Автор

Thanks for this great tutorial.
I tried chopper in one of my project and is working great. I'm a beginner in flutter development.
Now I'm trying to implement bloc pattern for the same project, following your bloc tutorial on weather app ofcourse 😀.
But one thing I can't figure out is, where to initialise chopper and where to dispose it.
My app is a shopping cart. So far I have loaded list of products from my own API (without bloc).
Now I want to use bloc for the same and later I have to show details of single product too.

Another problem I faced was when device is not online, widget shows null pointer exception. I handed that case by showing no internet in a text widget. I also tried adding a retry button, but when I call bulid(context) in the onPressed, nothing happens. What method should I call to reload the page? I'm using stateless widgets only. I didn't find the need to use stateful widget so far in this app.

colephelps
Автор

if " flutter packages pub run builder_runner watch" doesn't work,

add:
analyzer:

in pubspec.ymal file in dependecies section below provider:

roan
Автор

Idk, as to me, too much boilerplate code for the generator. Just write a few lines more and you can easily go without any choppers. I think code generator must do all this work itself, e.g. as OpenAPI does. OpenAPI has its problems also but you literally need to pass it only a swagger URL and it will generate all the classes on its own

JohnDoe-fvcu
Автор

Many of http api needs the use of headers providing a cookie one gets with an initial call, is in your plan to analyze the way one can obtain a cookie and use it during any calls? Thank you

dimitristotsios
Автор

Thanks for awesome tutorial. Please, can you help with a role-based authentication login tutorial that displays different drawer navigation bar for different users (e.g Student, Teacher, Parent)?

russellogieva
Автор

so now i need to learn chopper after learning Dio and http??

MoAdel
Автор

Really, I would like to thank you for you video and sharing those info with us but I wish if you could show us how to integrate Woo-commerce REST API With Flutter App and make Wordpress as backend system for my App?

naifandroid
Автор

Awesome tutorial! What theme are you using?

martinrupertbulquerin