REST API with Flutter | Step by step tutorial

Поділитися
Вставка
  • Опубліковано 31 лип 2024
  • Learn API integration with Flutter. Step by step tutorial
    JSON Placeholder : jsonplaceholder.typicode.com
    API : jsonplaceholder.typicode.com/...
    JSON to Dart : app.quicktype.io
    HTTP package : pub.dev/packages/http
    command: flutter pub add http
    0:00 - Introduction
    1:23 - JSON to model
    2:50 - Model-View binding
    5:03 - Http call
    9:18 - UI design
    If you like my work
    Buy me coffee on : ko-fi.com/afzalali15
    Join this channel to get access to perks:
    ua-cam.com/users/CodeXDevjoin
    Gears ========
    Camera 📸 || Canon 250D : amzn.to/34isdKr
    Mic 🎤 || Maono AU-04 : amzn.to/341g9wS
    #CodeX
    Connect with me on social media:
    FB: / codexdevs
    Twitter: / afzalali_dev
    LinkedIn: / afzalali15
    Discord: / discord

КОМЕНТАРІ • 251

  • @CodeXdev
    @CodeXdev  2 роки тому +11

    Git Source: github.com/afzalali15/REST-API-with-Flutter

    • @rishi9377
      @rishi9377 2 роки тому

      can you explaine Post, delete and put also???

    • @trieudien1990
      @trieudien1990 Рік тому

      Sir I am working on flutter connect moodle API is there any way I can get real-time data please help me thank you

  • @adeelshahid623
    @adeelshahid623 2 роки тому +46

    I'm 3 years experienced ionic Angular Mobile App developer. I've started flutter development two days ago😀 because I've to deal with a flutter E-Commerce project. So the point is being an experienced developer I can say that watching your video is worth going. Thanks for such good Stuff May Allah bless you.

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      Thanks for sharing 😍

    • @sumitrawat2289
      @sumitrawat2289 2 роки тому

      Brother plz help !
      I have 2 months left for the completion of my graduation , i know the basics of flutter , api , few sorting algorithms . How can i be job ready as flutter developer in 2 months .?

  • @kobbleton
    @kobbleton Рік тому +8

    Thanks a lot for this tutorial! 🔥 As for a beginer API calls was a real nightmare for me. But with your tutorial everything gets nice and clear for me. I'm sure with practice it will become like a second nature! Appreciate your effort a lot! 🙏🏻

  • @syedsaniulahsan2669
    @syedsaniulahsan2669 2 роки тому +1

    you are one of the good flutter guy. impressive tutorial. I hope people will recognize you more.

  • @calanm7880
    @calanm7880 2 роки тому +2

    Truly great tutorial, exceptional content and style!

  • @vicsystems
    @vicsystems 2 роки тому +3

    Thanks for the video, really helpful, anyone just getting into flutter and learn http request needs to watch this. Alot has actually changed in a couple of months. Especially with null safety.

    • @CodeXdev
      @CodeXdev  2 роки тому

      Thank you so much 😍

  • @saifshaikh6105
    @saifshaikh6105 2 роки тому

    Production quality is so much better. Same info covered in shorter time. Great work.

  • @smartcoding__
    @smartcoding__ Рік тому

    Finally I found what I've been looking for. Thanks! :)

  • @VidaeSaude78
    @VidaeSaude78 2 роки тому +5

    Obrigado mestre!continue com o ótimo conteúdo!saudações do Brasil

  • @dammythedesigner
    @dammythedesigner 10 місяців тому +1

    Wow, i feel so stupid right now, i've been struggling with APIs for over a week now and i am just 2 mins in and i am 10x smarter, thanks

  • @CodeXdev
    @CodeXdev  2 роки тому +10

    Can we get 1K likes in a week 🥰😉

    • @Mahi_00962
      @Mahi_00962 2 роки тому +1

      Yes

    • @bibeksaha4830
      @bibeksaha4830 2 роки тому

      Sir Please make a video on socket api please please please

  • @Kefmoles
    @Kefmoles Рік тому

    Thank you for this tutorial. You just earned a new sub

  • @kajib1
    @kajib1 2 роки тому

    thank you.. clear and straight forward to jump forward to implement api in flutter ❤

    • @CodeXdev
      @CodeXdev  2 роки тому

      Thank you so much @Bijak :)

  • @leleemagnu6831
    @leleemagnu6831 Рік тому

    incredibly well explained. Thank you!

  • @swerarizwan4164
    @swerarizwan4164 Рік тому

    Great work ever sir.... Uh didn't waste a single second👍

    • @CodeXdev
      @CodeXdev  Рік тому

      Thank you so much 😀

  • @joemdjossou
    @joemdjossou Рік тому

    Really and extremely helpful nice job 👌🏾👍🏾

  • @MatteoMusicStudio
    @MatteoMusicStudio 2 роки тому

    Amazing! THANK YOU!!!!!

  • @animeshbarai6804
    @animeshbarai6804 2 роки тому

    U r just awesome , waiting for more such quality content🥰🥰🥰🥰🥰

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      Subscribing is the only option 😆 see you in the next video 👍🏼

  • @suhailahmad9564
    @suhailahmad9564 Рік тому

    Love it 💕 thanks for the great knowledge

  • @c-lawbeats4594
    @c-lawbeats4594 Рік тому +1

    thanks for the helpful video. whenever i navigate into a page that requests data, i get a "null check operator used on a null value" error screen for like 0.1 seconds. then page loads with no problem. any idea why?

  • @flutterclone1849
    @flutterclone1849 8 місяців тому

    You explain very well and logically. Thank you for your good videos bro. In the hope of Allah, you will be more successful than you are.

    • @CodeXdev
      @CodeXdev  8 місяців тому

      Many many thanks

  • @architjain5108
    @architjain5108 2 роки тому

    Thankyou so much, I don't have words.

    • @CodeXdev
      @CodeXdev  2 роки тому

      You already wrote 7 words😜, thank you for the feedback 😍

  • @auroshisray9140
    @auroshisray9140 Рік тому

    Great content! Thank you

  • @maxxxtermind
    @maxxxtermind 7 місяців тому

    Awesome! Thanks!

  • @tedreams
    @tedreams Рік тому

    Thanks again for the tutorial! i got an issue my vscode complains when i try to return postFromJson(json); it looks like the method is not working

  • @e-tech7509
    @e-tech7509 Рік тому

    i subscribed because i loved the way you present it

    • @CodeXdev
      @CodeXdev  Рік тому

      Amazing, working hard to produce more awesome content. 😍

  • @destinygames3449
    @destinygames3449 Рік тому

    You are the best ❤

  • @hosseintasm4222
    @hosseintasm4222 2 роки тому

    Perfect. Bravo.

  • @jasonbraithwaite9204
    @jasonbraithwaite9204 2 роки тому +1

    Excellent Tutorial Thanks for that 👏👏👏

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      Glad it was helpful!

  • @kms12317
    @kms12317 2 роки тому

    If i don't have a json file and want to get data displayed in specific file , how to do this?

  • @bindusunar8396
    @bindusunar8396 Рік тому

    yeap its run totally thanks dude

  • @nuriddinburkhonov5214
    @nuriddinburkhonov5214 Рік тому

    Thank you very much!

  • @scalarcoding
    @scalarcoding Рік тому

    Thanks, this content is meaty!

  • @meidynsurawinata5874
    @meidynsurawinata5874 2 роки тому

    Thanks for the video.

  • @fal3881
    @fal3881 4 місяці тому

    in 12 minute i learn 3 things
    Flutter, Flutter applying API, and API it self
    kudos

  • @davidvalencia9813
    @davidvalencia9813 Рік тому

    Thanks, this vídeo helps me a lot

  • @davetelekom443
    @davetelekom443 6 місяців тому +1

    Ok. I did it step by step, and it works. I am looking for video with how to buttons get, post, delete, update.

  • @lunaRdeltaY
    @lunaRdeltaY 2 роки тому

    life saver!

  • @KojiKazama
    @KojiKazama 2 місяці тому

    Thanks. At 6:15 you mention that it is recommended to create an http client instance. By that, do you mean a global variable in the class? If so, would this class be static or a singleton to avoid re-instantiating the client instance? This is what I want to build for my project, that will also handle authentication, so with each call, do a check of the current token expiry datetime subtract the current datetime to see if my token is still valid, and if not, re-authenticate, update the auth headers and continue with the request.
    What I can't find is whether I should do this static class, or extend http client (or both). What are Flutter industry standards?

  • @user-xq2vp3rp2u
    @user-xq2vp3rp2u Рік тому

    Amazing!!!!

  • @walidlaanibi4006
    @walidlaanibi4006 Рік тому

    thank you amazing tuto

  • @masterofcampingMOC
    @masterofcampingMOC 2 роки тому

    hindos i love you 🔥🔥🔥🔥🔥🔥 ireally apreciate it bro

  • @quyetlevan6574
    @quyetlevan6574 Рік тому

    thanks you so much , great !!!!!

  • @Fauzyihsan
    @Fauzyihsan Рік тому

    thanks you man

  • @kunj_kanani
    @kunj_kanani 2 роки тому

    After long time n yaa thank you for the tshirt 🤝🏽🤝🏽

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      Yeah, I was on vacation and didn't managed to upload, but now I am back!

  • @abrorshamuradov1572
    @abrorshamuradov1572 2 роки тому

    you are the best

  • @nachiketasingh5760
    @nachiketasingh5760 Рік тому

    Thank you Brother🤩

  • @alfonsoromero3092
    @alfonsoromero3092 Рік тому

    thanks for the video. how to do when api key is needed?

  • @alahamedbasith
    @alahamedbasith 2 роки тому

    Super Bro lot of thanks

  • @shayanmallick6999
    @shayanmallick6999 2 роки тому

    Amazing tutorial❤

    • @CodeXdev
      @CodeXdev  2 роки тому

      Thank you! Cheers!

  • @angeloverlain
    @angeloverlain 2 роки тому

    Great tutorial

  • @rv9570
    @rv9570 2 роки тому

    Awesome. Can you make a video showing how to create our own rest api and connect to SQL server that will a great help. Thanks in advance

  • @hellgaming5921
    @hellgaming5921 19 днів тому

    Sir I have done it and am using it to get news in the app from a free api but the problem I am facing is that there are a limited number of requests I can make which turns into an error, can you tell how we can create our own apis with default data in it to show I. Our UI.

  • @asyraf1004
    @asyraf1004 2 роки тому +3

    Hello, this is a very well-explained video! My request: could you please combine it with the GET and POST method for this API topic using HTTP?

    • @CodeXdev
      @CodeXdev  2 роки тому +4

      Thanks for feedback 😍 Will do a video covering GET, POST, PUT n DELETE 👍🏼

  • @KJ-ve3ld
    @KJ-ve3ld Рік тому

    Can I use the same code to access users?
    How to do it if I have application password of my WordPress website?

  • @kenbinta2246
    @kenbinta2246 2 роки тому

    Great stuff

  • @chimwemwechawinga2336
    @chimwemwechawinga2336 2 роки тому

    easy ! this is greay sir

  • @chathurauddeepanaranathung9502

    This is wowwwwwwwwww broo... Keep it up

    • @CodeXdev
      @CodeXdev  Рік тому

      Thank you so much 😀

  • @adityagangane615
    @adityagangane615 11 місяців тому

    cThis very nice video than other api video of your channel . Can u give the video of all crud operation for same api. that will be very helpful.

  • @dimasismu5738
    @dimasismu5738 Рік тому

    are you have a videos auth login using rest api in flutter, bro?

  • @johnsunnyjohnsunny4296
    @johnsunnyjohnsunny4296 2 роки тому

    sir if i need to fetch login data from my website server and get data to my flutter app..how can i do it sir pls hel me sir

  • @panjavanparivendan3293
    @panjavanparivendan3293 Рік тому +1

    life saver

  • @fernoshaalfaridzi3274
    @fernoshaalfaridzi3274 2 роки тому

    sir , make video like this but using DIO. what is difference DIO and HTTP ? which one is better ?

  • @sudhanshunamdev4801
    @sudhanshunamdev4801 2 роки тому +1

    Hey! Can you make a tutorial on how to make geofence in Flutter ?

  • @kutticchathan
    @kutticchathan 2 роки тому

    Great video indeed. How are you bringing up those context menus to create the widgets? Is there an extension you have to install?

    • @CodeXdev
      @CodeXdev  2 роки тому

      Thats in built, command+. on mac system

  • @bububoy8247
    @bububoy8247 2 роки тому

    Cool ❤‍🔥

  • @shivamagrawal6991
    @shivamagrawal6991 2 роки тому

    Can you help me
    I am stuck on google map
    How can I visible all markers info window???
    Please

  • @TrikNgonlen
    @TrikNgonlen 2 роки тому

    Awesome...thank you...

    • @CodeXdev
      @CodeXdev  2 роки тому

      Welcome 😊 appreciate your comment!

  • @sidhantburnwal4023
    @sidhantburnwal4023 Рік тому

    why you are using not equal to sign in container section??

  • @sounsavdan7086
    @sounsavdan7086 2 роки тому +1

    can you show us to load local json data?

  • @sadiaghani3237
    @sadiaghani3237 Рік тому

    Sir mera postFromJson ka method ni arha? Red underline ata ha

  • @user-tu4rw8lb9p
    @user-tu4rw8lb9p Рік тому +1

    So this is GET operation, what about POST?

  • @nameisvamshi5129
    @nameisvamshi5129 2 роки тому +1

    Hi bro,
    can you please do a tutorial on flutter php mysql REST API...that would be so much helpful to me.

  • @cagatay9556
    @cagatay9556 2 роки тому

    Hello there,thanks for the great work I really learned a lot but I wanna ask a question. How can I turn this a news app? How should replace the news api into this? Yeah I know there is a lot of examples of that but they're too old

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      Change URL, replace model with News model and you'r done!

  • @codecrafts6726
    @codecrafts6726 2 роки тому

    Hey, thanks for your tutorials, I'm a big fan. I wanted to ask which software you use to record and edit your videos.

    • @CodeXdev
      @CodeXdev  2 роки тому +2

      I record using OBS and edit inside Premier Pro

    • @codecrafts6726
      @codecrafts6726 2 роки тому +1

      @@CodeXdev thanks

  • @racismoe
    @racismoe 2 роки тому

    Hello sir, I've followed your tutorial and it works perfectly for basic API calls. Unfortunately, I have found difficulties trying to call and display data from APis where data is nested ("id:", "name:", "number:" etc). Do you have any ideas or tutorials that can help me ? I have not found anything helpful on the internet, perhaps I am just bad because I am a beginner but any help would be welcome. Thank you.

  • @kenann5614
    @kenann5614 2 роки тому

    Good job

  • @proNOOBIE_
    @proNOOBIE_ 2 роки тому +4

    It would be nice if there was a video explaining the implementation of search bar

  • @user-og3ph3ss2n
    @user-og3ph3ss2n Рік тому

    I owe you my life *bows*

  • @abgthscode6326
    @abgthscode6326 2 роки тому

    Is service an another name for repository?

  • @shaabzz
    @shaabzz 2 роки тому

    i was finding the exact tutorial...thankyou so much.
    can you also do firebase tutorial and sql database plsss

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      Great to hear that it helped, Surely planning Firebase tutorials soon!

  • @misturaojulari9707
    @misturaojulari9707 2 роки тому +1

    Hi, I am pretty new to flutter, I would appreciate if anyone could help with this error:
    E/flutter ( 2874): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'Null' is not a subtype of type 'Map'
    Apparently this error is pointing to my model in Post class.

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      It means that you are trying to convert 'Null' response to json (Map).. put a check before converting response to json.
      If you want to discuss further, please connect on Discord link in description, community will help you there.

    • @misturaojulari9707
      @misturaojulari9707 2 роки тому

      @@CodeXdev Thanks alot 🙏🏼

  • @PaschalAOgba
    @PaschalAOgba 2 роки тому +3

    I want to learn how to handle apiKey and accessToken on real projects.
    Please do same using RapidApi endpoint to fetch list of soccer teams and few meta data.

    • @CodeXdev
      @CodeXdev  2 роки тому

      RapidApi itself requires some knowledge to setup and get the access token, Currently this tutorial only teaches the basic of API. Hopefully in future I will do tutorial with custom APIs

    • @PaschalAOgba
      @PaschalAOgba 2 роки тому

      @@CodeXdev i agree with you that it's not an easy challenge.
      However, i'll be very pleased if you attend to my request.

  • @buddhikap.desilva2897
    @buddhikap.desilva2897 2 роки тому

    Cool

  • @technologyhacks2110
    @technologyhacks2110 2 роки тому +1

    Sir plz make a video on isolates. And how to use isolates with api

  • @ribsk
    @ribsk Рік тому

    love you

  • @ashwing924
    @ashwing924 Рік тому +1

    Kindly Make a detailed tutorial of BLOC...

  • @sounsavdan1033
    @sounsavdan1033 2 роки тому

    Can you make a torturial how to get data to textfield when we use mouse to click on data just like mouse click event in C# .NET

  • @chiragsingh5701
    @chiragsingh5701 2 роки тому +1

    Can anyone help me in this I am getting error in this line of code.
    posts = await RemoteService().getPosts();

    • @CodeXdev
      @CodeXdev  2 роки тому

      What is that error? You can share on discord group

  • @javhaasuhochir8126
    @javhaasuhochir8126 Рік тому

    thanks

  • @rise4gamers506
    @rise4gamers506 2 роки тому

    Thankxs for converter

  • @elyasnaimzada3919
    @elyasnaimzada3919 2 роки тому +1

    Great tutorial
    i installed your code on android phone and the data never loads. the screen stays on loading page. any reason why. it works on my computer but when i build the apk and install on android phone it hangs

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      Internet connection, either you don’t have permission in manifest or you don’t have data 😬

  • @poochaser6618
    @poochaser6618 14 днів тому

    what you meant by restful api integration ,because the api integration must follow some rule to implement rest ful api integration? otherwise it's just only api integration

  • @mohsinikram8921
    @mohsinikram8921 2 роки тому +1

    Can you make a video on Mvvm with api calling using getX and with pagination as well?

    • @CodeXdev
      @CodeXdev  2 роки тому

      I have a video for API calling using GetX... you need to learn pagination separately and apply in this 😉👍🏼

  • @rajadurai.
    @rajadurai. Рік тому

    Last few yrs i following your chennal . I saw all video and also live stream.can you give dedicated video for bloc .

    • @CodeXdev
      @CodeXdev  Рік тому +1

      Thank you so much for being connected with CodeX. I will try to cover Bloc in of my video.. but you can get fair idea looking at StreamController video on my channel.

  • @randomness3588
    @randomness3588 2 роки тому

    I tried to follow your tutorial but when I pasted the pists from jason place holder to to app.quicktype, following exactly tye way you did it, it gave a different lines of code/model and theres not even a word "class" in it..when I pasted it in my vscode where Im coding flutter, it gave so many errors..what do you think went wrong?..is it really possible that even if I follow you exactly, I will get a different code?..please advise..thanks

    • @CodeXdev
      @CodeXdev  2 роки тому

      Hello, you should get same class if you have pasted correct json. May be json has changed on jsonplaceholder site but still, it should give you valid class

    • @randomness3588
      @randomness3588 2 роки тому

      @@CodeXdev that the problem coz it really did not return a class and the size of codes is just about 1/3 of what you got..it's really very few..maybe it changed..anyway, thanks for replying..I appreciate it so much..Im still continuing my self learning via UA-cam. Im trying my best because I really want to learn it 👍

    • @CodeXdev
      @CodeXdev  2 роки тому

      Great to hear that your are putting efforts to learn it, you can join on discord link in description and get some guidance over there

    • @randomness3588
      @randomness3588 2 роки тому

      @@CodeXdev thanks..joined discord ..my first time to use discord 👍😊

  • @harshchudasma-it3394
    @harshchudasma-it3394 2 роки тому +1

    Hello, Please Give Me a Link of Your Github Account to Some Project for How can we SetUp For Project Routes,Utils,Modules,CommonConstant in Getx

  • @mazenalsakkaf
    @mazenalsakkaf 2 роки тому

    Amazing

    • @CodeXdev
      @CodeXdev  2 роки тому

      Thanks for listening

  • @denistomas33
    @denistomas33 8 місяців тому

    Thanks for that claps🎉

  • @rakulagn4598
    @rakulagn4598 2 роки тому +3

    Kindly Post Complete Rest Api Model Which Means Multiple API Data Fetch , API Parameters , Headers Concept Returning Data By Validating Headers , Multiple Endpoints This Could be Help Us lot

    • @CodeXdev
      @CodeXdev  2 роки тому +1

      Yes, good suggestion for advance level tutorial