Get data from Api in flutter - HTTP Requests in flutter

Поділитися
Вставка
  • Опубліковано 19 жов 2024

КОМЕНТАРІ • 190

  • @nuur6019
    @nuur6019 3 роки тому +55

    if you have problems with the data.length; fix it with putting 'AsyncSnapshot' before snapshot in the builder parameter;
    builder: (context, AsyncSnapshot snapshot)

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

    Thank you for your tutorial. It really helps me, find a lot but most of them not working with flutter 2022. Containing many bugs. One bug to fix, is to add AsyncSnapshot before snapshot
    "builder: (context,AsyncSnapshot snapshot)"
    Anyway, I have just subscribe to your channel.

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

    This tutorial ignores two important things that video makers keeps ignorering all the times. (1) Showing an error if network is not available. (2) Detecting if returned Map(data) is empty and show "not data text" or something and probably showing a loading spinner for the slow networks instead of keeping users waiting on a blank screen, but loading spinner isn't important. Anyways it was a great tutorial.
    Many thanks

  • @nishantj1685
    @nishantj1685 3 роки тому +17

    It would be really helpful if the code was available in text on medium or git. Nice work by the way.

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

    there are alot of explanations I have watched, but yours really helped me.

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

    really appreciated this is the first video in which i become cleared about the concept of api and how to work with it

  • @my_wave_app
    @my_wave_app 3 місяці тому

    thanks for this tutorial video it really helped me to build my mobile app, (analytics dashboard for social media content creator) which is now live! it has been few days only but this video was very helpful!
    API was a bit trickier but could make it work :) cheers

  • @ir2guru
    @ir2guru 3 роки тому +1

    you just saved me from a terrible nightmares. Thanks a lot

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

    Yo!!! you just got a new subscriber, your lecture is suscint and clear. Wow!!! i love you sir. Keep up the good work. i'll definitly watch all your videos and drop feedbacks.

  • @anandrago6826
    @anandrago6826 3 роки тому

    Last few days i try to know flutter api integration. so I watch lot of api integration videos on UA-cam. but all the videos are uploaded minimum 4 month ago. So all my tried was failed i facing lot of error. finally I watch this video i see lot of different from that old videos.
    Thank you for this video.

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

    Very informative and helpful video.
    Love from PAKISTAN.

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

    Amazing Huge Concept in less time Thank You Sir...!!!!!!

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

    Thank you bro it's too easy and helpful, I saw most of the video but that's not clear and give more errors, but in this video is perfectly used, Thank you so much 🤝

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

    simple and easy method of teaching. thanks!

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

    Simplicity is your asset. Great!

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

    Thank you soooo much sir for this video.. it is very helpful..

  • @xpwahab1
    @xpwahab1 3 роки тому

    your teaching style is awesome.
    Sad to see you inactive

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

    bro u literally solved my problem , thank you so much

  • @BBFTW36
    @BBFTW36 3 роки тому +1

    Ty so so much dude, especially for the Uri part.

  • @codeinbantai5663
    @codeinbantai5663 3 роки тому +1

    Very much thank You saved my day with the Uri fact

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

    I've been struggling with this.
    Instant sub

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

    you' are amazing! Thanks for the video

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

    Thank you so much it's helpful 👍

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

    thank you so much, it really helps me!

  • @SantoshYadav-lc3hi
    @SantoshYadav-lc3hi 2 роки тому +1

    i like to way to explain it just amazing

  • @SirHelios
    @SirHelios 3 роки тому +1

    Thanks a lot - great tutorial!

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

    Hi :). I'm doing everything like you and here what happens: '_Map' is not a subtype of type 'Iterable'
    What am I doing wrong if you don't have this issue?
    I start to become powerless...

  • @rhadityawahyu6690
    @rhadityawahyu6690 3 роки тому +6

    thanks for the tutorial bro, but i have an error like this "The property 'length' can't be unconditionally accessed because the receiver can be 'null'.
    Try making the access conditional (using '?.') or adding a null check to the target ('!')." what should i do?

    • @marketjokes
      @marketjokes 3 роки тому +4

      ubah sdk agan ke sdk: ">=2.7.0 < 3.0.0"
      nanti akan banyak sintax yg berubah seperti penggunaan required dan late
      akan di hilangkan

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

      @@marketjokes Thanks, Bro I was stuck here since 4hrs

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

      @@khalidfaisal8999 vai help me. kivabe sdk 2.7.0 anbo

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

      same issue

  • @debidattaray6646
    @debidattaray6646 3 роки тому +1

    Sir please add some more content your style of teaching has clarity

  • @zahrayousefi9400
    @zahrayousefi9400 3 роки тому +1

    simple and amazing. well done

  • @m.tuladharreddy8234
    @m.tuladharreddy8234 2 роки тому

    Thank you so much it was sooo helpfull

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

    The type 'Map' used in the 'for' loop must implement Iterable.

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

    You are really good

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

    After run this code I have faced some problems. Like..
    1.The method '[]' can't be unconditionally invoked because the receiver can be 'null.
    2. The property 'length' can't be unconditionally accessed because the receiver can be 'null'.
    Please tell me what was the solution.

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

      fix it with putting 'AsyncSnapshot' before snapshot in the builder parameter;
      builder: (context, AsyncSnapshot snapshot)

  • @manasasalapaka8436
    @manasasalapaka8436 3 роки тому +1

    very nice explanation..would you please tell me how to add images??
    thanks in advance

  • @prabaljainn
    @prabaljainn 3 роки тому

    Literally helped me, thanks Dude

  • @CHOTADONTHEGAMER
    @CHOTADONTHEGAMER 3 роки тому +1

    Brother so here is the error The Getter length isnt defined and []. Isnt drfined for type OBJECT

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

    I think this code wouldn't work any more because of null safety

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

    in future videos, can you try to make the audio volume a bit better? I can hardly hear you even at high volume.

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

    Thank you very much.

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

    I am facing the error on snapshot.data.length . Error Shows In The Property 'length' can't be unconditionly accessed because the receiver can be 'null',

    • @flutterwithme2530
      @flutterwithme2530  3 роки тому

      Check if you have upgraded to null safety and update the code accordingly.

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

    Thank You very match

  • @MegaKuqi
    @MegaKuqi 3 роки тому +1

    What is exactly datafromapi.iml ? this file is missing by me. That is maybe the reason why nothing shows in the console when I press the Button ?

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

    thanks, it helped a lot

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

    hey bro if api have Millions, hundreds of thousands of data, is it okay to use a for loop?

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

    I tried this code. But i am facing an error at snapshot.data.length
    Showing that - property length cannot be unconditionally accessed because the receiver can be null.
    Can u pls tell me hw to correct it.

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

      Look at the answer of Nuur: if you have problems with the data.length; fix it with putting 'AsyncSnapshot' before snapshot in the builder parameter;

  • @AliJawad-q5d
    @AliJawad-q5d 2 роки тому

    Bro. If you can reply. Can you please tell us how to implement search and create a new page with the user details in it?

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

    If you have error with snapshot.data.length just put sdk: ">=2.7.0 < 3.0.0"

  • @forme5794
    @forme5794 3 роки тому

    I am new to flutter , so I don't know details. I am getting "the property length cannot be unconditionally accessed because the reciever can be null" error. Found no proper solution in online. How do I solve this?

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

    flutter can enable or disable airplane mode on thirts with android. Thank you

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

    But what if json data it self is non-string type ? i tried to use my boolean type json but it wont work

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

    Bro I am getting this error (error: The operator '[]' isn't defined for the type 'Object'. ) did the same way as u. snapshot.data[i].country this is showing me error I've been trying this from 2 days help me out but while trying to print the data in for loop at 7:35 it is getting printed

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

      I had the same problem so Someone on UA-cam suggested that we should use (context, AsyncSnapshot snapshot) instead of (context, snapshot).
      And then I got the length with this snapshot.data!.length

  • @jovanemullings
    @jovanemullings 3 роки тому +1

    so you would set the api key as the unencoded path ?

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

    Sir please make a video on Flutter Integrate DataBase

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

    sir, any chance we can fetch data from json using streambuilder ?

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

    Well done ✅

  • @thazeroword646
    @thazeroword646 3 роки тому +1

    Very nice tutorial

  • @JacoOlwagen
    @JacoOlwagen 3 роки тому +1

    great! thank you

  • @marco_di
    @marco_di 3 роки тому

    Realy awesome :-)
    what does the code snippet look like if the data is saved as locale json? A search box would also be great on this code base

    • @flutterwithme2530
      @flutterwithme2530  3 роки тому +1

      Will get a video on that soon.

    • @marco_di
      @marco_di 3 роки тому

      @@flutterwithme2530 I'm already looking forward to it :-)

  • @prabaljainn
    @prabaljainn 3 роки тому +1

    i understood this video of yours but in my emulator its showing WAIT as i created if(snapshot.data == null) return container(child: Text('WAIT")) meaning My SNAPSHOT.data == null
    what the heck is the problem i cant understand

  • @musamdaka1606
    @musamdaka1606 3 роки тому

    I have an error on class DataFromAPI extends statefulWidget how do you call that one to be fixed?

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

    Snapshot.data.length is not working in itemCount for ListView.builder

    • @flutterwithme2530
      @flutterwithme2530  3 роки тому

      would ask you to check the code again, it's working absolutely fine.
      What is the error you get?

    • @MegaKuqi
      @MegaKuqi 3 роки тому

      @@flutterwithme2530 when I press the Button it shows nothing in console, ?

  • @sejalarora6923
    @sejalarora6923 3 роки тому +1

    I'm still facing an error of "string' can't be assigned to the parameter type 'uri'" can you please help me out

  • @balamurugesan1838
    @balamurugesan1838 3 роки тому

    Hi. why do we need to use FOR loop for iterating the values?

    • @flutterwithme2530
      @flutterwithme2530  3 роки тому

      we are going to repeat it to fetch all the data as per the data from array we want.
      Hope this helps.

  • @arpitrahi5917
    @arpitrahi5917 3 роки тому

    You did not tell how to fetch that address which was inside another jsonArray? tell us that too.

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

    @Flutter With Me Is there code on Github?

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

    Bravo !!!

  • @marcellodeus
    @marcellodeus 3 роки тому

    im doing the same as the video, but im reciving a error in snapshot.data.lenght: The property 'length' can't be unconditionally accessed because the receiver can be 'null'.
    Please, can someone help me?

  • @isha3851
    @isha3851 3 роки тому +1

    Thank you very much for this tutorial. But i am facing issues with final keyword if i decalre a variable as final within a class and then creating a constructor just like you did then its showing me error and asking me to add required keyword in front of every final variable.
    example:-
    Class Users{
    final email,username;
    Users(required this.email, required this.username);
    }
    i cant make parameter as optional what should i do?

    • @mohitgajjar8862
      @mohitgajjar8862 3 роки тому

      give variable data types , use " final String email, username; "

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

    Hi! it keeps on saying loading data, please help, data doesn't load even after the api is called successfully

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

      you forget to return the "users" from "getUserData" function.

  • @entertainmentzone8797
    @entertainmentzone8797 3 роки тому

    thanks a lot bro

  • @abhishekgiri1586
    @abhishekgiri1586 3 роки тому +1

    In this you not show how to display address values? Please I request you to make a seperate video and teach us how to display address value?

    • @clinihard
      @clinihard 3 роки тому

      Hello! Just put a subtitle in the "for":
      } else
      return ListView.builder(
      itemCount: snapshot.data.length,
      itemBuilder: (context, i) {
      return ListTile(
      title: Text(snapshot.data[i].nome),
      subtitle: Text(snapshot.data[i].endereco),
      );
      });

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

    how can I fetch the addresses ? and i wanna save it in a list with map

  • @omaryousifkamal4290
    @omaryousifkamal4290 3 роки тому

    thank you sir!

  • @anandrago6826
    @anandrago6826 3 роки тому +1

    I am facing error at
    itemCount: snapshot.data.length,
    anad
    title: Text(snapshot.data[i].name),
    Please help

    • @flutterwithme2530
      @flutterwithme2530  3 роки тому

      What is the error you are getting?

    • @anandrago6826
      @anandrago6826 3 роки тому

      @@flutterwithme2530 i change SDK 2.12.0 to SDK 2.7.0 now it's working
      Thank you for your reply.

  • @roc_kstark
    @roc_kstark 3 роки тому +1

    master!!

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

    Ty bosss

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

    I had a problem and it appears that it cannot be called because it is null

  • @alfonsoromero3092
    @alfonsoromero3092 3 роки тому

    nice videos, thanks. How you can import images? thank again

  • @dev.faizan
    @dev.faizan 2 роки тому

    great

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

    Unhandled Exception: type 'Null' is not a subtype of type 'String' >(

  • @priteshsapkale200
    @priteshsapkale200 3 роки тому +1

    Username value can't be fetch ...rest working fine...plz others also do check...

    • @flutterwithme2530
      @flutterwithme2530  3 роки тому

      You will need to write that code part to update username value which can then be returned.

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

    It keeps showing loading data.

  • @jabsdbaa7727
    @jabsdbaa7727 3 роки тому

    thanks bro

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

    Inverted commas?? They are called quotes

  • @shabnamnaseemahmed.5072
    @shabnamnaseemahmed.5072 2 роки тому

    how we can add custom headers in http headers?

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

    Still, snapshot.data.length not resolved, Even i used the AsyncSnapshot.. Please tell me the solution if any.. it so thankful

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

      replace builder with ->"builder: (context,AsyncSnapshot snapshot)"

  • @tuankietngo650
    @tuankietngo650 3 роки тому

    Do you have souce code this post ?

  • @mahmudahmod3844
    @mahmudahmod3844 3 роки тому

    Can you please make a flutter music app with how to fetch api and play music

  • @srinivasvxefccyiju9003
    @srinivasvxefccyiju9003 3 роки тому

    Can u make same video with using django sir

  • @sanaboby5175
    @sanaboby5175 3 роки тому +1

    i want to get address in human readable format current location user how please make video

  • @StarBattle08
    @StarBattle08 3 роки тому +1

    what if the data is xml?

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

    how to get the data of company and geo

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

    Nuur
    há 8 meses
    se você tiver problemas com o data.length; corrija-o colocando 'AsyncSnapshot' antes do snapshot no parâmetro do construtor; construtor: (contexto, instantâneo AsyncSnapshot)
    vlwww

  • @xavieracaling6866
    @xavieracaling6866 3 роки тому

    data.length can't be unconditionally accessed because the receiver can be null

    • @mrmusanda3576
      @mrmusanda3576 3 роки тому

      did you fix the issue?

    • @xavieracaling6866
      @xavieracaling6866 3 роки тому

      @@mrmusanda3576 yes i figured it out of my own code tho.. made my own line of code instead

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

    how to get street in address in that link

  • @otukenn79
    @otukenn79 3 роки тому

    How can we get divs inside of html tag

    • @flutterwithme2530
      @flutterwithme2530  3 роки тому

      Could you clarify your question a bit more?

    • @otukenn79
      @otukenn79 3 роки тому

      @@flutterwithme2530 I mean, I want to see between of tags

  • @HKOALFAHD
    @HKOALFAHD 3 роки тому

    I have this error

  • @TrustShare
    @TrustShare 3 роки тому +1

    github?

    • @flutterwithme2530
      @flutterwithme2530  3 роки тому

      didn't save the source code, will try and get that to you soon.

  • @nabilazaroual1729
    @nabilazaroual1729 3 роки тому

    can i have the source code please !!!?