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

Поделиться
HTML-код
  • Опубликовано: 3 фев 2025

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

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

    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

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

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

  • @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

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

    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 Год назад +2

      @@thetechbrotherss Sir he says right.

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

      Thanks for helping

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

      I was also facing that issue thanks for sharing

  • @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

  • @CoderUmar-hw6ef
    @CoderUmar-hw6ef 6 месяцев назад +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.

  • @xul.fekkaar
    @xul.fekkaar Год назад

    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.

  • @Madina_tul_ilm6384
    @Madina_tul_ilm6384 6 месяцев назад +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/

  • @ayushmishra8505
    @ayushmishra8505 2 года назад +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  2 года назад +1

      test api in postman and then follow the process carefully

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

      @@thetechbrotherss Already didi it API works well in postman

  • @ramzanch4055
    @ramzanch4055 3 года назад +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  3 года назад +1

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

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

      @@thetechbrotherss sure sir

  • @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

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

    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

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

    Amazing video brother! Keep it up!

  • @kamalmaher9920
    @kamalmaher9920 2 года назад +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  2 года назад

      Check you must he doing something wrong

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

      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));
      }

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

    End level 💯

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

    Crystal Clear explaination.thank you sirr :)

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

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

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

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

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

      These are type of loops, we are looping on data

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

    excellent video. very nice explanation

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

      thank you do subscribe and share with your friends

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

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

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

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

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

    very well explained

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

    I Love your video great work sir ❤

  • @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

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

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

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

    Great explanation sir 👍👍👍

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

    bro love from india

  • @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

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

    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  6 месяцев назад

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

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

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

  • @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?

  • @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.

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

    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  5 месяцев назад

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

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

    thanks for making this video

  • @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.

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

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

  • @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

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

    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  5 месяцев назад

      nice

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

      @@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

  • @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 2 года назад

      @@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 😑

  • @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..

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

    Can't get output of api integrarion in chrome?

  • @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.

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

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

  • @ABHISINGH-ty7ln
    @ABHISINGH-ty7ln Год назад

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

  • @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

  • @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

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

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

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

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

  • @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

  • @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

  • @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

  • @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

  • @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!

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

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

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

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

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

    sir why we use snapshot in the future builder widget

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

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

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

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

  • @HrithikRajput-o6b
    @HrithikRajput-o6b Год назад

    should i call async func inside build

  • @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?

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

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

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

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

  • @user-Rania-n7m
    @user-Rania-n7m Год назад

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

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

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

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

    hey brother the api response returns null.
    any solution

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

    sir this Api code is not working .

  • @Songme55
    @Songme55 2 года назад +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  2 года назад

      Please follow the video carefully it say data is coming null

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

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

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

      use try catch to catch the error

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

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

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

    nice

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

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

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

      null safety means value cannot be null for variable

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

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

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

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

  • @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/

  • @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

  • @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

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

    what is the purpose of postList.clear().

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

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

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

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

  • @022_cse-csdeepakkumarsain7
    @022_cse-csdeepakkumarsain7 2 года назад

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

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

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

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

    nice sir

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

    why we crate model plz explain

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

    This API code is not working

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

      It’s working bro check the comments working with everyone

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

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

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

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

  • @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.

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

    same code no error still API not working?

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

      Api is working check again you must be flint something wrong

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

      i think snapshot mai data nahe arha sirf loading show kr raha hai kya karo ab?

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

      @@thetechbrotherss thank you for your reply and last mai maine apka code pora copy keya still not hit api

  • @Desh_Ki_Baat.
    @Desh_Ki_Baat. Месяц назад

    hlo asif sir mere api connectivity me non nullable ka problems aa rha h pls sir how to resolve that problems pls pls guide me sir pls pls pls pls pls pls pls pls pls plspls plsp lsp

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

      bro test api in postman and then debug line by also print snapshot for better error logs

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

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

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

      i think url is not correct, test the api in postman

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

    Boss Please make video about dio...plz

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

    Sir apni loop k andher Map q le liya can you explain loop......plz sir

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

    ya asa ho k ap ki API dynamic ho means bar bar change ho rhi ho to>?

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

      phr apko streams use krni parhin ge

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

      @@thetechbrotherss isma b jub Hum
      for(Map i in data){
      Model.add(PostModel.fromJson(i));//jub isko i assign karty han to kehta hye k Map ki value dain iska koi hall bta dain plz
      }

  • @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());
      }
      }

  • @DevrajSingh-kz9ph
    @DevrajSingh-kz9ph 2 года назад +1

    Sir table calendar m api data kase pass kerte hai is pr ak video bna do please sir

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

    Osm video

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

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

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

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