Part - 7 | Flutter Get API call with Null Safety | Building List with JSON Data using Future Builder

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024
  • In this video we will fetch the data from server via API and then display the data into out ListView Builder using Future Builder. We will also see how we can create model or how we can convert JSON data into Dart model classes
    ► API Link ➜ jsonplaceholde...
    source code: github.com/axi...
    ► PlayList ➜ • Flutter REST API Tutor...
    ► Join Facebook Group ➜ / 983554978866765
    _____________/Connect On Social Media\____________
    ► linkedin:➜ / axiftaj
    ► Instagram:➜ / axif_taj
    ► Facebook:➜ / aaxiftaj
    ► Twitter:➜ / axiftaj
    ► GitHub:➜ github.com/axi...
    ► Hire me on Fiver:➜ www.fiverr.com...
    =========================================
    ► Flutter Blog App Playlist: • Flutter Blog App with ...
    ► How to capture image from camera in flutter:
    ► Link : • How to capture Image f...
    ► My Card App Flutter :
    ► User Circular Avatar Part 1 : • My Card App || Flutter...
    ► Use fonts in flutter Part 2 : • My Card App || Flutter...
    ► Final Part 3 : • My Card App || Flutter...
    ►Covid-19 Tracker App using Rest API's :
    • Create Coronavirus (CO...
    ►Firebase Blog App Android Java:
    • Firebase Blog App - Ho...
    ►C++ Tutorials :
    • C++ Programming Tutori... .
    rest apis, flutter rest api tutorials crash course,
    For business queries : axiftaj@gmail.com
    Thank you for watching my channel do give feedback about this video.
    #flutter #fluttertutorial #form #components #flutter #asiftajtech

Комментарии • 311

  • @thetechbrotherss
    @thetechbrotherss  2 года назад +14

    source code:
    github.com/axiftaj/Flutter-Rest-Api-Tutorials-With-Example
    do give a start if you it helped.

    • @azeemhussain1109
      @azeemhussain1109 2 года назад +1

      already given you star and shared with friends, wish you, to get more stars. amazing tutorials series

  • @muhammadhassan4289
    @muhammadhassan4289 Год назад +24

    for those people who are facing issue in map function in for loop, map function is a little bit modified so here is the code that u have to copy paste
    for (Map i in data) {
    postList.add(PostsModel.fromJson(i));
    }

    • @thetechbrotherss
      @thetechbrotherss  Год назад +2

      It's not necessary , it will work the way i taught them but most of the student didn't follow carefully that's why they faced isssues

    • @noumaniqbal4965
      @noumaniqbal4965 Год назад +2

      Yes you are right. I face this problem for one whole day.

    • @noumaniqbal4965
      @noumaniqbal4965 Год назад +1

      @@thetechbrotherss Sir he says right.

    • @sufyantalib8289
      @sufyantalib8289 Год назад +1

      Thanks for helping

    • @shahzadwarraich2911
      @shahzadwarraich2911 Год назад +1

      I was also facing that issue thanks for sharing

  • @cs_010_adityaverma2
    @cs_010_adityaverma2 Год назад +3

    struggling from past 4 days with APIs integration now finally understand it very well ........love from INDIA sir

  • @AmeerHamza-vd9sb
    @AmeerHamza-vd9sb Год назад +4

    1st time I feel like APi's are easy to integrate ❤️ big respect for you!

  • @vishnuprajapati89
    @vishnuprajapati89 2 года назад +2

    Dhanyawad bro. Yadi apke jese guru ho sikhane ko to kisi ko koi doubt nahi rahega and again thanks bro...❤️

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +1

      Thank you subscribe kr dain share kr dain doston k sath

  • @krutidewda3152
    @krutidewda3152 Год назад +5

    You deserve millions of subscriber sirr, jus t love how you explained APIs so easily, I was finding it difficult to understand from a very long time

  • @CoderUmar-hw6ef
    @CoderUmar-hw6ef 3 месяца назад +3

    Appreciate your Sophistication of HardWork for Public 😍

  • @sumitkumar-jn8he
    @sumitkumar-jn8he 3 года назад +1

    Sir one by one tut dekha bhaut ache se apne explained kiya hai. Eager for next continue tut video post.

  • @codeWithSanny
    @codeWithSanny Год назад

    The explanation was awosome. I would never need to ask Google for the materials you have covered in the lecture... Love from Flutter Interns : )

  • @praveensuthar3036
    @praveensuthar3036 2 года назад +1

    Thanks you sir muje bohot kuch sikhne ko mila muje bohot problem hoti jab api call karta tha par ab muje dout clear hogye Thanks

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      Great it helped, do subscribe, like the video and share it with your friends.

  • @syedshabbarraza6384
    @syedshabbarraza6384 4 месяца назад +1

    JAZAKAllah sir aaj bhi aap ki waja sy kuch new sekhny ko mila

  • @sanjaypatidar7605
    @sanjaypatidar7605 2 года назад +1

    sir proper smj aaya best tutorial sir ji👍👍😊 i'm from india ❤

  • @Himanshu_Explore
    @Himanshu_Explore 2 года назад +2

    Wow sir thankyou so much fir this! I need this kind of tutorial thankyou sir 🙂love from india💌

  • @happycoding7079
    @happycoding7079 2 года назад +1

    Thanks, Buddy finally Caught all the concepts till here IDK why but I took 5 retakes then I got it

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +3

      hahahahhah this is experience, support me on insta: instagram.com/thetechbrotherss/

  • @muhammadhanif1636
    @muhammadhanif1636 2 года назад

    best tutorial I have seen in youtube

  • @nouman1213
    @nouman1213 3 года назад

    explained very well... wait for next video

    • @thetechbrotherss
      @thetechbrotherss  3 года назад +1

      Will upload very soon. Hopefully will complete this series this week.

  • @starkstreak5583
    @starkstreak5583 2 года назад +1

    very nice and easy explanation sir

  • @kamalmaher9920
    @kamalmaher9920 Год назад +2

    sir when we started the loop
    for (map i in data){
    postlist.add(postmodel.formjson(i));
    }
    in this code the i is not working in fromjson code. it through the error and not working.

    • @thetechbrotherss
      @thetechbrotherss  Год назад

      Check you must he doing something wrong

    • @ashhadahmed72
      @ashhadahmed72 3 месяца назад

      for those people who are facing issue in map function in for loop, map function is a little bit modified so here is the code that u have to copy paste
      for (Map i in data) {
      postList.add(PostsModel.fromJson(i));
      }

  • @ramzanch4055
    @ramzanch4055 2 года назад +1

    Bro v nice keep it up i follow your play list and learn a lot about api and abele to integrate api in my freelance projects.

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +1

      Glad to hear that, so subscribe and share with your friend.

    • @ramzanch4055
      @ramzanch4055 2 года назад

      @@thetechbrotherss sure sir

  • @batishqureshi
    @batishqureshi 2 года назад +1

    Amazing video brother! Keep it up!

  • @amitpersonal6820
    @amitpersonal6820 Год назад

    If anyone have error
    in for loop
    Use
    for (map i in data)

  • @preetiahuja8672
    @preetiahuja8672 Год назад

    Crystal Clear explaination.thank you sirr :)

    • @thetechbrotherss
      @thetechbrotherss  Год назад +1

      Go ahead you will love it, make sure to read the description and first comment. Do subscribe and share with your friends

  • @shivanisoni9803
    @shivanisoni9803 2 года назад +1

    excellent video. very nice explanation

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      thank you do subscribe and share with your friends

  • @TheHospitalityEmpire
    @TheHospitalityEmpire 2 года назад +2

    The argument type 'Map' can't be assigned to the parameter type 'Map' this erroe showing up when doing step you did at 12:02 min in video

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +1

      Error is self explanatory click on this error go to the model and change string to dynamic and please watch video carefully till end.

    • @rehanhamayun1353
      @rehanhamayun1353 2 года назад +1

      Change the Map to "Map

  • @ayushmishra8505
    @ayushmishra8505 Год назад +1

    Not working - 14:58 when you print postList length in list view
    I write exact same code but my phone screen is empty not getting any data in listview.
    Try everything.

    • @thetechbrotherss
      @thetechbrotherss  Год назад +1

      test api in postman and then follow the process carefully

    • @ayushmishra8505
      @ayushmishra8505 Год назад

      @@thetechbrotherss Already didi it API works well in postman

  • @inoxentmuqeet6727
    @inoxentmuqeet6727 Год назад +1

    End level 💯

  • @Gulfam-b2f
    @Gulfam-b2f 6 месяцев назад

    very well explained

  • @allinonewithSnehaa
    @allinonewithSnehaa Год назад

    I Love your video great work sir ❤

  • @demodemo9429
    @demodemo9429 2 года назад

    Great explanation sir 👍👍👍

  • @tusharprajapati6431
    @tusharprajapati6431 2 года назад +1

    bro love from india

  • @kirticabhandari623
    @kirticabhandari623 2 года назад +1

    I have a question.. please give me reply. Why we are creating model for JSON? I don't understand, why it is need?

  • @iShahzainAhmed
    @iShahzainAhmed 2 года назад +1

    Sir you explained everything very greatly in this video, but I don't know why this entire concept of creating List and FutureBuilder seemed very difficult to me, or maybe I need to watch it multiple times to understand it properly.

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +2

      First time it's always difficult with practice and as you move forward it will be very easy

    • @iShahzainAhmed
      @iShahzainAhmed 2 года назад +1

      @@thetechbrotherss In Shaa Allah sir I'll try practicing it!

  • @Songme55
    @Songme55 Год назад +1

    The body might complete normally, causing 'null' to be returned, but the return type, 'Widget', is a potentially non-nullable type. this error is coming

    • @thetechbrotherss
      @thetechbrotherss  Год назад

      Please follow the video carefully it say data is coming null

  • @g4gamer330
    @g4gamer330 2 года назад +1

    salam sir sir ma na ya poucha na tha ka ap na for loop ka bahar q return kar wa ya hai data ku andar bhi tu hu sakhta tha

  • @wasimzaman674
    @wasimzaman674 2 года назад +1

    Assalam O Alekum.....
    Jesa k aap ne kaha k agar post API ka jo response hai agar us mai se list yani k array ka naam hota to hamara model achay se ban jaata, kya model ko sahi tarah se banane k liye hum us response ko explicitly change nahi kar saktay ? kya hum is pooray response ko object mai wrap kar k is list ko naam nahi de saktay?

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      JSON response backend engineer bnata ha ap usko jaise kahin gy wo set kr dy ga r ap easyly handle kr lain

  • @hammadahmad7963
    @hammadahmad7963 Год назад +1

    The argument type 'Map' can't be assigned to the parameter type 'Map'.dart

  • @goodwebdevelopers2582
    @goodwebdevelopers2582 2 года назад +1

    Hi sir Im getting an error, please help
    for (Map i in data) {
    postList.add(PostsModel.fromJson(i));
    }
    The i value in line postList.add(PostsModel.fromJson(i)); is giving the following error
    The argument type 'Map' can't be assigned to the parameter type 'Map'

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +2

      user 'Map as message is self explanatory.

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +1

      Go to your model and change it.

    • @muhammadjavedrafique4592
      @muhammadjavedrafique4592 2 года назад +3

      write for(Map i in data) insted of for(Map i in data)

    • @asadullah4269
      @asadullah4269 Год назад

      @@muhammadjavedrafique4592 brother i used this but now its give me this error for data ( the type string used in for loop must implemnt iterable)

    • @pushpeshpainuly5526
      @pushpeshpainuly5526 Год назад

      bro when i print "i" it throw error 😑

  • @hammadahmad7963
    @hammadahmad7963 Год назад +1

    Sir I got error in postList.add(PostModel.fromJson(i));
    in (i)

  • @shahab1479
    @shahab1479 2 года назад +1

    thanks for making this video

  • @ShahSikander
    @ShahSikander 4 месяца назад

    if statment ko execute kr k loading show ho rha screen pr agy move nai kr rha else tk?aysa q ho rha hy ..JsonToDart plugin kamnai krr rr to google pr Json to dart use key ta kya uss wja sy data show nai ho rha yaa kia issue ho skta hy?

    • @thetechbrotherss
      @thetechbrotherss  4 месяца назад

      aise is liye ho raha ha k q k ap check ni kr rahy k error kahan par ha
      use try and catch

  • @Mohsin_Chaudary
    @Mohsin_Chaudary 3 месяца назад

    Sir using this methos app runs smmoth on emulator and show response but on physical device it gives error after giving internet acces in .xml file and building apk it it showing blank screen

    • @thetechbrotherss
      @thetechbrotherss  3 месяца назад

      it means ap k parent widget ma issues ha, use expanded and write place

  • @alihassan5651
    @alihassan5651 2 года назад +1

    Thanks soo much for this

  • @zoshypermar
    @zoshypermar 2 года назад +1

    Excellent Sir ! Sir tell me command in android studio for wrap with widgets. What command you type for wrap with widgets? Here control+ Enter not working for wrap with widgets

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      Btaie ro ha alr + shift

    • @zoshypermar
      @zoshypermar 2 года назад

      @@thetechbrotherss
      Alt+Enter se huwa thanks Sir..

  • @viralcartoon567
    @viralcartoon567 2 года назад +1

    Can you please provide the JSON to dart model convertor extension in visual studio code because I am trying to download different Jason to dart converter it was not workin

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +1

      You can use any online website for JSON to dart converter. I have not used VS code so i don't know.

    • @binqasimmasood8899
      @binqasimmasood8899 2 года назад

      did u solve this error

  • @S4eedKhan
    @S4eedKhan 3 месяца назад

    Asalam u Alaikum Respected Sir,
    in line 24 where you use for loop
    for(Map I in data){
    postList.add(myModel.fromJson(i)); is not working for me
    with the help of gemini I got this code which is working correctly
    postList = (data as List).map((i) => myModel.fromJson(i)).toList();

    • @thetechbrotherss
      @thetechbrotherss  3 месяца назад

      nice

    • @S4eedKhan
      @S4eedKhan 3 месяца назад

      @@thetechbrotherss Thanks Sir,
      Looking forward to meet you someday''
      Yesterday a friend told me that I usually see Asif Taj in IT Park Peshawar,donno if its true or not

  • @anasmalix8593
    @anasmalix8593 2 года назад +1

    why i am not familiar with this code i think i am missing some pre-requisite for this code to understand i cant understand this syntax

  • @azcreativemedia7118
    @azcreativemedia7118 Год назад

    Can't get output of api integrarion in chrome?

  • @sherazkhan_1044
    @sherazkhan_1044 2 года назад +1

    sir Assalam walikom
    sir mai vscode use kar raha hu mai konsi extension use karu please sir i am stucked off.

  • @zenZcoder
    @zenZcoder Год назад

    FormatException (FormatException: Unexpected character (at character 1)
    ^
    )
    I am getting this error

  • @hemant2406
    @hemant2406 Год назад

    Sir mera code run hogya h pr mujhe steps yaad nhi rehti h...mujhe prior knowledge nhi h programming ki dart hi first language h jo me sikh rha hu...plz guide what i have to do

  • @dushyantsharma2415
    @dushyantsharma2415 Год назад

    yeh error sy pareshan hu kya kru _TypeError (type '_InternalLinkedHashMap' is not a subtype of type 'Iterable')

  • @hassanalivlogger
    @hassanalivlogger 2 года назад +1

    nice

  • @hauntednightshindi
    @hauntednightshindi 2 года назад +1

    hello brother please help me with this ---------- The name 'PostsModel' isn't a type so it can't be used as a type argument.-------- I am getting this error but you are not

  • @FantasyChannelShuvo
    @FantasyChannelShuvo 3 года назад +1

    Nice video....

    • @thetechbrotherss
      @thetechbrotherss  3 года назад +1

      Thanks, do subscribe and share within your friend circle.

    • @FantasyChannelShuvo
      @FantasyChannelShuvo 3 года назад +1

      @@thetechbrotherss i have already done..sir will u plz make this video....?

    • @thetechbrotherss
      @thetechbrotherss  3 года назад

      Bro i have already provided your the content you need to learn how to utilise things according to your requirements based on concepts you have learn. This is actual development.

  • @taimoormanzoor7386
    @taimoormanzoor7386 2 года назад

    Sir can tell me what the difference between if I use that "AsyncSnapshot snapshot" or only "snapshot"?

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +1

      List is returning list data in async you can define whatever the data type returning it could be bool, i suggest you watch my widget of the week series for better understanding of future and stream builder with snapshot.
      do subscribe and share with your friends.
      support me on insta: instagram.com/thetechbrotherss/

  • @fawadahmed2306
    @fawadahmed2306 2 года назад +1

    sir kindly also explain the model .from json, tojson,encoe,decode,etc..

  • @asimreyazuddin3494
    @asimreyazuddin3494 6 месяцев назад

    11:24 I was not able to follow the process there. Could you explain the for loop again?

    • @thetechbrotherss
      @thetechbrotherss  6 месяцев назад +1

      These are type of loops, we are looping on data

  • @ABHISINGH-ty7ln
    @ABHISINGH-ty7ln 10 месяцев назад

    Sir i got error when i create class name PostsModel it's not show posts-model.dart

  • @basitfaizan7928
    @basitfaizan7928 Год назад

    Sir I wants to make Netflix clone app with authentication features using firebase and I will use apis to get movies so the problem here is that how should I make my folder structure so that it looks professional

  • @md.abulmoshadchowdhury1646
    @md.abulmoshadchowdhury1646 Год назад

    Hello brother! everything is fine but i don't understand the line object.fromJson/toJson ? what is the functinality of these two functions ? if u would discuss then would be more helpful for me!

    • @thetechbrotherss
      @thetechbrotherss  Год назад

      it map the values if you change the parameter name in model you will null values

  • @sk10120
    @sk10120 Год назад

    can you please explain the use of postList.clear() that you added ?

  • @Kumar2k12
    @Kumar2k12 2 года назад +1

    I am subscribed to utr videos. Please explain How to use JsonToDart using android studio build json model

    • @thetechbrotherss
      @thetechbrotherss  2 года назад +1

      please watch part 5 and 6 i teach how you can do that

    • @Kumar2k12
      @Kumar2k12 2 года назад

      @@thetechbrotherss Yes Thank you for that and I have watched it , but in settings of jsonToDart which to be preffered. It is very canfusing as I have tried it.

  • @mohdzaid-3430
    @mohdzaid-3430 Год назад

    i dint get the API only loading is showing at top of the screen
    so plzz help

  • @virtalHospital
    @virtalHospital Год назад

    sir jab ma postmodel ki file bna raha hn to mera pas 4 files create ho rahi hain,,
    1 address.dart
    2 company.dart
    3 geo.dart
    aur json place holder sa data copy kia ha and same data ha array sa start ha

  • @FantasyChannelShuvo
    @FantasyChannelShuvo 3 года назад +1

    Give me same project done with expansion list with builder and data from local json file... Plz....sir reply......

    • @thetechbrotherss
      @thetechbrotherss  3 года назад +1

      Please watched my video on expansion list and then part 10 of this video series. You will get your answers. And yes i reply to every comment and feel free to contact via social media platform.

    • @FantasyChannelShuvo
      @FantasyChannelShuvo 3 года назад +1

      @@thetechbrotherss give ur fb contact....

    • @thetechbrotherss
      @thetechbrotherss  3 года назад

      See description
      In part 10 just place the the code of my expansion tile video into your if block snapshot.has and see the magic.

  • @priyamohod1510
    @priyamohod1510 Год назад

    hello, I am not able to select that option new file Json to dart, how to solve this?

  • @SSAPro
    @SSAPro 2 года назад +1

    This API code is not working

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      It’s working bro check the comments working with everyone

  • @SarimAli-k7g
    @SarimAli-k7g Год назад

    so hamein pehle api se model nikalna hoga postman se, and than usko convert krna hoga?

  • @kmailabbas5000
    @kmailabbas5000 2 года назад +1

    sir sime aap jaisa code kia hai likin screen per Text k ilawa kuch or show nahi ho raha

  • @Arbic_calligraphy65
    @Arbic_calligraphy65 Год назад

    nice sir

  • @meenakshibhasin9456
    @meenakshibhasin9456 Год назад

    Hi, thanks for the video. I have issue. when i am trying to display the id and userid. it is showing error. Can you please explain how to do that

  • @user-Rania-n7m
    @user-Rania-n7m 10 месяцев назад

    sir, you have shown only 3 screens in this video, but there are lot of screens in the source code.

    • @thetechbrotherss
      @thetechbrotherss  10 месяцев назад

      it's a complete playlist

    • @user-Rania-n7m
      @user-Rania-n7m 10 месяцев назад

      @@thetechbrotherss oops! sorry. I didn't notice. Thankyou sir

  • @nardrev5437
    @nardrev5437 Год назад

    how to pass a query when i log in and the id from that login will go to the url?

  • @The_Suraj_Khot
    @The_Suraj_Khot 7 месяцев назад

    tnx bro..

  • @Hisk1496
    @Hisk1496 Год назад

    Sir i coded it in android studio and in this code i have no error, when i run it in chrome web it is showing me no data, its showing blank page is there any solution for this issue. How can I run it in Google Chrome as well?

  • @zahrachoksi6571
    @zahrachoksi6571 2 месяца назад

    Hello maine same code likha hai phir bhi loading ... Hii show hota hai what is the reason behind this ???

    • @thetechbrotherss
      @thetechbrotherss  2 месяца назад

      use try catch to catch the error

    • @educationforever314
      @educationforever314 Месяц назад

      I skipped the ! operator in the following code. Check if you made the same mistake.
      if (!snapshot.hasData) {
      return const Text('loading');

  • @gamesden8021
    @gamesden8021 Год назад

    sir please yeah answer kardain ky for(map i in data) yeah ju likhna hai woh list ma jason ky object ko add karna ky liya likha hai na or yeah map kuhn use kiya hai plz

  • @bobhero7
    @bobhero7 2 года назад +1

    Matlab toh samjhaye ki Aap ne if else and for loop kyu use kiya..

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      sub kuch smjhaya ha bar bar smjhaya ha k kiss condition ma use krna ha kiss ma ni

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      ap pehle api k structure ko smjho

  • @ghufranahmed840
    @ghufranahmed840 Год назад

    Sir I have watched this video multiple time even with full concentration but I'm not getting a single concept. What should I do please guide me. Thank you

  • @akhileshgoswami9497
    @akhileshgoswami9497 3 года назад

    Osm video

  • @wardaamjad
    @wardaamjad Год назад

    Is it necessary to create Live REST API's to integrate them with flutter?

  • @shashidharchinna1203
    @shashidharchinna1203 Год назад

    am getting error at homescreen page, Map i in data=> in getting error

    • @thetechbrotherss
      @thetechbrotherss  Год назад

      Please watch video carefully, understand the concepts and fix it. You must be doing something wrong

  • @hashimjahangir9427
    @hashimjahangir9427 2 года назад +1

    hey brother the api response returns null.
    any solution

  • @theinfluencer940
    @theinfluencer940 Год назад

    19:28 pr custom list jo banai hai us ko clear ku karty hain? can someone expalin reason behind it.

  • @ssagaming4545
    @ssagaming4545 2 года назад +1

    sir this Api code is not working .

  • @joymazumder-kr2og
    @joymazumder-kr2og 5 месяцев назад

    I dont understand , what is null safety ? and how i understand when null safety or not ?

    • @thetechbrotherss
      @thetechbrotherss  5 месяцев назад +1

      null safety means value cannot be null for variable

  • @zareenharoon4287
    @zareenharoon4287 2 года назад +1

    very nicely explain.can you kindly make an edit in this video, i need to take the token and user id through the login and keep it along in all pages including this list view plus add search to the ist view as well thankyou

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      Store the value of user id in shared preference in the get the value via future function or using async your own method then pass it to query. For searching listview builder go ahead your watch covid app tutorials i have explain how we can implement it. Do subscribe and share with your friends.

    • @zareenharoon4287
      @zareenharoon4287 2 года назад

      @@thetechbrotherss thankyou for the quick respnse. i am trying all the methods but coudnt succed...can you give me any example code where i can get the shared prefrences as well as can get the list itm values from the api as well.
      here is the code i cant get the values in bidy.dont know what i am doing wrong.
      please help me out so i can get my next step.i need these prefrences in all the pages.
      //defined to collect the data in String values
      String token = "";
      String userid = "";
      String databaseid = "";
      @override
      void initState() {
      //TODO:implement initState
      super.initState();
      //Function called
      _showItemList();
      }
      // Variable for collecting data from database
      var data;
      //_login function is built to call data from the server
      Future _showItemList() async {
      try {
      //Fetch Saved Variables Data from SharedPreferences to send in Header
      SharedPreferences prefs = await SharedPreferences.getInstance();
      setState(() {
      token = prefs.getString("Token")!;
      userid = prefs.getString("UserId")!;
      databaseid = prefs.getString("DatabaseId")!;
      print('prefs->token=' + token);
      print('prefs->userid=' + userid);
      print('prefs->database=' + databaseid);
      });
      Map apiHeader = {
      "Content-type": "application/json",
      'token': token,
      'userID': userid,
      'databaseID': databaseid,
      };
      Map apiBody = {
      "ItemCategory": "",
      "DepartmentID": "",
      "VendorNumber": "",
      "StoreID": "1001"
      };
      //For GetItemsList

      final String url =
      " api url here";
      Uri uri = Uri.parse(url);
      //final finalUri = uri.replace(queryParameters: apiBody); //USE THIS
      final finalUri = uri; //USE THIS
      http.Response response = await http.get(
      finalUri,
      headers: apiHeader,
      );
      if (response.statusCode == 200) {
      data = jsonDecode(response.body.toString());
      print('response.body=' + response.body);
      ScaffoldMessenger.of(context)
      .showSnackBar(SnackBar(content: Text("Data : ${data}")));
      } else {
      // showAlertDialog(context);
      print('There was an error while connecting to the server.');
      print(response.statusCode);
      }
      } catch (e) {
      print(e.toString());
      }
      }

  • @noumanrafiq4409
    @noumanrafiq4409 Год назад

    Sir, how to create your own api(i mean real API) ? is there any specific platform for it...

  • @hfurqan980
    @hfurqan980 10 месяцев назад

    sir why we use snapshot in the future builder widget

    • @thetechbrotherss
      @thetechbrotherss  10 месяцев назад

      this is just a name you can use any name, it returns different states

  • @JagdishOnYT
    @JagdishOnYT Год назад

    I want to show data one by one, like after pressing next button, next item should be shown how to implement that

  • @ashikmahmood4018
    @ashikmahmood4018 2 года назад +1

    Boss Please make video about dio...plz

  • @harshitagrawal6334
    @harshitagrawal6334 9 месяцев назад

    what is the purpose of postList.clear().

    • @thetechbrotherss
      @thetechbrotherss  9 месяцев назад

      to clear the list before adding the data into list to avoid duplication

  • @AliButt-fk7oz
    @AliButt-fk7oz Год назад

    brother snaps hot data hasData is true but kuch b show hii ho rha?? na title na id

  • @medhavisharma1429
    @medhavisharma1429 Год назад

    waaah Taj

  • @022_cse-csdeepakkumarsain7
    @022_cse-csdeepakkumarsain7 Год назад

    Sir i think the line 22 code should be inside the if statement starting at line 23

    • @thetechbrotherss
      @thetechbrotherss  Год назад

      I don't remember right now but you can learn the procedure and implement it

  • @Vidushishukla-s5v
    @Vidushishukla-s5v Год назад

    we can't decode data without checking response code (10:15) this is flow error

  • @saeculorum8184
    @saeculorum8184 2 года назад +1

    Can you post full code or a github repo?
    very good tutorial

    • @thetechbrotherss
      @thetechbrotherss  2 года назад

      Don't forget to give a start.
      github.com/axiftaj/Flutter-Rest-Api-Tutorials-With-Example

  • @muhammadraheel2721
    @muhammadraheel2721 11 месяцев назад

    Sir g humna jo i use kiya ha wo tu kahi declear ni krwaya tu wo kesy use ho gya

  • @HrithikRajput-o6b
    @HrithikRajput-o6b 10 месяцев назад

    should i call async func inside build

  • @neerajbhatt2461
    @neerajbhatt2461 Год назад

    Bhai pura flutter bootcamp follow kr ra hu pichle sare videos samjh aye but seriously ye video m kuch bhi samjh nhi aya mujhe