ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Dio Connectivity Retry Interceptor - Flutter Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 มี.ค. 2020
  • 📗 Learn from the written tutorial 👇👇
    resocoder.com/dio-connectivit...
    📧 Get Flutter news 📰 and resources:
    👉 flutter.education
    👨‍💻 Do you write good code? Find out now!
    resocoder.com/good-code-quiz
    Performing HTTP requests is all fun and games until there's no internet connection. Sure, you can display a sad error message or a "Chrome dinosaur" to the user, but wouldn't it be better to take the initiative and automatically retry the request when the user connects to a WiFi network or enables mobile data? This is precisely what we're going to implement in this tutorial.
    Go to my website for more information, code examples, and articles:
    ● resocoder.com
    Follow me on social media:
    ● / resocoder
    ● / resocoder
    ● / resocoder

ความคิดเห็น • 92

  • @ilkercankaya3779
    @ilkercankaya3779 3 ปีที่แล้ว

    you are a legend, best flutter tutorials ever. amazing!

  • @jimmyfmedina
    @jimmyfmedina 4 ปีที่แล้ว +1

    Excelent video, very useful. This is one of my favorite channels to learn Flutter.

  • @chetan6406
    @chetan6406 4 ปีที่แล้ว

    Thanks matt for this series, absolutely really helpful content.

  • @shwepyisoe5240
    @shwepyisoe5240 3 ปีที่แล้ว

    Thanks man. You're really saving my life. I won't forget your help.

  • @marekchojecki4746
    @marekchojecki4746 4 ปีที่แล้ว +16

    Damn, you are video making beast. DDD twice a week plus „blue” tuts of librares. Im gonna buy you another coffee because I don’t think you sleep at all :)

    • @ResoCoder
      @ResoCoder  4 ปีที่แล้ว +3

      Haha 😄 Thanks! When it comes to actual coffee, I drink a very conservative amount (for a programmer, at least 😅) 3 small cups a day.

    • @marekchojecki4746
      @marekchojecki4746 4 ปีที่แล้ว +3

      Same here, but I have to be strong to not drink fourth :) Anyway bought you one but you deserved whole starbucks tbh for your effort. Keep goin 👊

  • @luisrogelio98
    @luisrogelio98 4 ปีที่แล้ว +2

    You thought it was your average Flutter tutorial but it was I DIO

  • @Im_Ninooo
    @Im_Ninooo 3 ปีที่แล้ว

    1 minute into the video and I already like it :)

  • @waldherrweiss
    @waldherrweiss 4 ปีที่แล้ว +4

    Great Video, as always.
    Just as a tip: You could use the any method of the Stream class to reduce the code of your scheduleRequestRetry function. It returns a future which completes with true when the given condition is true. In your case that would be the check if the ConnectivityResult is not none. Alternatively there's the await for Statement built into dart which is also syntactically nicer to read.

  • @coolprashantmailbox
    @coolprashantmailbox 4 ปีที่แล้ว

    Thank you so much for this video, it's really helpful

  • @dangdatraymonddelmut3230
    @dangdatraymonddelmut3230 2 ปีที่แล้ว +5

    This video is amazing and you are a good teacher. One issue I noticed is that when there is no Internet connection the circular progress indicator keeps looping infinitely, it would have been better you give user an error message instead of the infinite loop which left the user with no idea what was going on.

  • @suryasingh9763
    @suryasingh9763 3 ปีที่แล้ว

    great work Man!!

  • @sumanparajuli229
    @sumanparajuli229 4 ปีที่แล้ว

    Sir..... why i dont find you earlier.... Just today i found your youtube channel and i also enrolled your resocoder.com website...Just wow.. amazing content with clear visualization or explanation.... Just go on.. At the first day of enrolling your channel i become a fan boy from nepal....

  • @verryondrums
    @verryondrums 4 ปีที่แล้ว

    Always pressing like before event watching it ^^

  • @AiEnthusiast999
    @AiEnthusiast999 3 ปีที่แล้ว

    big thank you !!!

  • @easazade
    @easazade 4 ปีที่แล้ว

    thanks man, 👍❤

  • @andreygritsay762
    @andreygritsay762 3 ปีที่แล้ว +3

    With this approach you can't catch request errors as by default. It just won't work and so you can't show an error state to a user. It will be just an endless running function. It would be much better if you could show an error to a user and also schedule a retry request

  • @Sameer_Kumar
    @Sameer_Kumar 4 ปีที่แล้ว

    Hey man!
    Brilliant tutorial. 👍
    Btw, which font scheme you are using here, looks impressive.

  • @etiennetheodore
    @etiennetheodore 3 ปีที่แล้ว

    Hi thanks for the video !! Do you have any idea how to unit test this custom interceptor ?

  • @loicfonkam9206
    @loicfonkam9206 4 ปีที่แล้ว

    Thanks for the tutorial!
    Can we get the retry functionality with chopper?

  • @dennisszymanski4821
    @dennisszymanski4821 4 ปีที่แล้ว +1

    Hey Matt.. I think it's fantastic, that you listen to "fan"-requested video-topics .. I really appreciate that .. So i want to drop my first video request: GraphQL with Flutter .. I don't know if this topic suits your channel, because I think that you would have to explain GraphQL first before you can jump into the Flutter related stuff .. But maaaaaybe if you dont have a better video idea you could do that .. I would really love to see your opinion and your implementation of that. But if you decide that this is no topic for a video on this channel I can understand that :) Anyway: Keep up the great work !

    • @ResoCoder
      @ResoCoder  4 ปีที่แล้ว +2

      Hello Dennis! I've been thinking about making GraphQL tutorials for a while now, it's just not a topic which lends itself to one-off tutorials very well. I'd need to do a short series which I will not do right now BUT I think I'll be able to pull it off in the future.

  • @kulwinderrahal6941
    @kulwinderrahal6941 4 ปีที่แล้ว +1

    i am native android developer and used retrofit in all of projects, now i’m working on flutter and starting new project which option is best DIO or CHOPPER ?

  • @user-bx8uh4gl6s
    @user-bx8uh4gl6s 2 ปีที่แล้ว

    Sir, thank you your video show, If I want to useing the Dio 4.0.4 to do "scheduleRequestRetry" method, how can I do?

  • @MasterWingman
    @MasterWingman 3 ปีที่แล้ว +1

    Can you please do a video on making a get request that requires basic authentication? I've been having a hard time with this.

  • @sergiofranklin8809
    @sergiofranklin8809 4 ปีที่แล้ว

    How did you learn Flutter? From which tutorials or books, give some recommendations please

  • @jatinchaudhary383
    @jatinchaudhary383 3 ปีที่แล้ว

    Which vs code theme you are using including the font style as it is looking attractive

  • @devqubs
    @devqubs 4 ปีที่แล้ว +1

    why not use websocket to check connectivity to make sure server is really running?

  • @amrinjaffni4268
    @amrinjaffni4268 4 ปีที่แล้ว

    anyone knows how to change a certain keyword's color? currently I'm using Material Theme Darker, but somehow my "this" keywords remain in white color

  • @thegorilla8395
    @thegorilla8395 3 ปีที่แล้ว

    dio vs http ? which package i should choose ?

  • @h3w45
    @h3w45 4 ปีที่แล้ว

    Please make a video about asynchronous programming in flutter.

  • @mithuns8410
    @mithuns8410 4 ปีที่แล้ว +1

    how can i add Dio caching to this interceptor?

  • @medamoniaravind8092
    @medamoniaravind8092 4 ปีที่แล้ว

    i want to show the network connectivity error message screen to the user how to do please reply me, thank for your awesome tutorials on flutter

  • @muhsinzyne695
    @muhsinzyne695 2 ปีที่แล้ว

    Hey is there any breaking changes .? for flutter new version ..?

  • @mahesh8948
    @mahesh8948 4 ปีที่แล้ว

    How can I implement for token expire scenario.

  • @top10top54
    @top10top54 3 ปีที่แล้ว

    Is there any way to pause, resume and download using dio Package? I need dio show download progress that can be resumed and paused... Help

  • @SachinKumar-ie7wh
    @SachinKumar-ie7wh 4 ปีที่แล้ว

    Finally you came up with Dio. ☺️✌️.
    Dio Vs chopper. which one do you preffer?

  • @andreybudnikov5920
    @andreybudnikov5920 3 ปีที่แล้ว

    Tell me. 3:26 min, you clicked a button and the editor displayed the line of code that was causing the problem. How did you do this? Is this some kind of editor plugin?

  • @skirllexrude8170
    @skirllexrude8170 2 ปีที่แล้ว

    Reso i am using dio interceptor but 304 status caught in onerror callback is there any workaround to send it as response to the calling function

  • @nourshobier3157
    @nourshobier3157 4 ปีที่แล้ว

    The font you are using is awesome, what's its name?

  • @nicoteufel
    @nicoteufel 4 ปีที่แล้ว +2

    When you're working on an own project, do you plan your app down to the smallest detail?

    • @ResoCoder
      @ResoCoder  4 ปีที่แล้ว +4

      No, I plan the most important parts as a high-level overview and then plan out small chunks as we go.

  • @wajeehulhassan_vii
    @wajeehulhassan_vii 4 ปีที่แล้ว +7

    I was waiting for DDD part 5.

    • @jw4659
      @jw4659 4 ปีที่แล้ว

      Me too - is the DDD tutorial over?

    • @alex_kenbo
      @alex_kenbo 4 ปีที่แล้ว

      +

    • @arifikhsanudin9724
      @arifikhsanudin9724 4 ปีที่แล้ว

      I waiting until it's done so that i can do marathon

  • @hamidjahandideh8142
    @hamidjahandideh8142 4 ปีที่แล้ว

    please make some video for BDD
    or some video for TDD vs DDD vs BDD vs ATDD
    thanks reso

  • @vivekjunghamal5730
    @vivekjunghamal5730 2 ปีที่แล้ว

    there are lot of changes in current dio : 4.0. Any workaround to this. Like now function doesn't return future but returns void

  • @ranskiseee
    @ranskiseee 3 ปีที่แล้ว +1

    Please help in dio version 4.0

  • @dipeshkhanal7407
    @dipeshkhanal7407 3 ปีที่แล้ว

    Nowadays the null safety brings lots of change, can you please make the video again for dio 4.0.0

  • @wavemusic7153
    @wavemusic7153 3 ปีที่แล้ว

    How can we use thi code for whole app connectivity

  • @mithuns8410
    @mithuns8410 4 ปีที่แล้ว

    Could you please add dio caching for http data

  • @Adnankhan-jr3gz
    @Adnankhan-jr3gz 4 ปีที่แล้ว

    i am requesting you to make a video on refresh token in interceptors by using Dio.

  • @kaushalzod5162
    @kaushalzod5162 3 ปีที่แล้ว +3

    how did you created that snippet at 11:15 can you share please

    • @kaushalzod5162
      @kaushalzod5162 3 ปีที่แล้ว

      "Class Creator From the name of File": {
      "prefix": "classFile",
      "body": [
      "class ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/} {",
      "$1",
      "}"
      ],
      "description": "Class Creator From the name of File"
      }

  • @fredili3002
    @fredili3002 9 หลายเดือนก่อน

    @Reso Coder help this video is 3 years ago and its no longer working how do i fix it

  • @MohamedDernoun
    @MohamedDernoun 4 ปีที่แล้ว +1

    Thanks for the efforts that you do, but please keep them short, TL&DR 😊

    • @ResoCoder
      @ResoCoder  4 ปีที่แล้ว +2

      TL:Read the written article then 😉

    • @MohamedDernoun
      @MohamedDernoun 4 ปีที่แล้ว

      ​@@ResoCoder reading the written excite you to watch the video, like a trap 😅

    • @ResoCoder
      @ResoCoder  4 ปีที่แล้ว +1

      @@MohamedDernoun 😂 that's my evil goal.

  • @polyrtm5545
    @polyrtm5545 4 ปีที่แล้ว

    KONO DIO DA

  • @berthojoris
    @berthojoris 8 หลายเดือนก่อน

    Hi reso, please update with new version of dio please :)

  • @programan6391
    @programan6391 4 ปีที่แล้ว +2

    Code coverage in flutter is very unclear, I would like to see you explain that.

  • @petscutest2055
    @petscutest2055 4 ปีที่แล้ว

    what is your font name

  • @vahaggrigoruyan7228
    @vahaggrigoruyan7228 11 หลายเดือนก่อน

    socketException(socketException: Failed host lookup: ' ' (os error: no address associated with hostname. errno =7))
    Hello whatever i do in the debug mode it stops untill i hit the play button and in the stack there is this error please help me with it i am stuck on it for days already

  • @TestThenPush
    @TestThenPush 4 ปีที่แล้ว

    Can you please tell how can I achieve this functionality with Chopper?

  • @mike_zander
    @mike_zander 2 ปีที่แล้ว

    When the device goes to sleep and wakes up is there any way to resume download?

  • @programan6391
    @programan6391 4 ปีที่แล้ว

    Hey Matt, how are doing your country/city?

    • @ResoCoder
      @ResoCoder  4 ปีที่แล้ว +1

      We're in a semi-enforced lock down mode. No deaths yet, thankfully.

  • @NotAChannel4
    @NotAChannel4 4 ปีที่แล้ว +1

    invalid link

  • @musliminontong2918
    @musliminontong2918 ปีที่แล้ว

    Please update the video

  • @Mayanktaker
    @Mayanktaker 4 ปีที่แล้ว

    Make Flutter WordPress Graphql video please

  • @adenaziz3600
    @adenaziz3600 4 ปีที่แล้ว

    would you mind share your vscode settings & extensions?
    i don't have that inheritance line in your editor like:
    ---child: xx
    | mainAxis
    | children
    |------

    • @ResoCoder
      @ResoCoder  4 ปีที่แล้ว +1

      Sure, it's actually a part of the Dart extension. dartcode.org/releases/v3-4/#flutter-outline

    • @adenaziz3600
      @adenaziz3600 4 ปีที่แล้ว

      @@ResoCoder thank you!

  • @danvilela
    @danvilela 4 ปีที่แล้ว +1

    "very nice looking UI".. an app bar, a text and a button LOL

  • @faizulla5838
    @faizulla5838 2 ปีที่แล้ว

    where is code? bro ))

  • @arifikhsanudin9724
    @arifikhsanudin9724 4 ปีที่แล้ว

    How much is your ram?

  • @thedude61636
    @thedude61636 3 ปีที่แล้ว

    it's not DAIOO
    it's me dio

  • @plebulus
    @plebulus 4 ปีที่แล้ว

    I would never try trust something named DIO