Flutter fromJson() to convert json to class object | Dart

Поділитися
Вставка
  • Опубліковано 14 кві 2022
  • You will see how to use named constructor fromJson() to convert json to class object. You will also see how to use jsonDecode() and fromJson() together
    More here
    www.dbestech.com/tutorials/da...
    Buy me a coffee
    www.buymeacoffee.com/dbestech...
  • Наука та технологія

КОМЕНТАРІ • 30

  • @hosseintasm4222
    @hosseintasm4222 Рік тому +3

    Very excellent, simple and understandable.

  • @lyawileh.a8741
    @lyawileh.a8741 4 місяці тому

    Waalykumsalaam warahmatullahi wabarakatuh. Nice demonstration, barakallahu fiykum.

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

      Like and share please

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

    very very comprehensive.
    Please explain it further with .map()...toList() methods, as in how do i know when its required in my code and what do they do?

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

      You call .map() on a map object. You call this because you may want to change the value of the map's key or do something using those keys and values. Once you are done you return them as a list using toList(). If you use toList() it becomes a list. If it's a list them you can access the items using index.
      So whenever you need a list from a map you would do this.
      mapObject.entries.map((e)=>e.value).toList();
      More here www.dbestech.com/tutorials/understanding-dart-map-and-list-for-flutter-development-explained-step-by-step-when-and-how-to-use

  • @user-ec2gu9bo1l
    @user-ec2gu9bo1l 2 роки тому

    Please describe the next video for getand post with Filter how it works to explain other codes. thnks from kurdistan iraq see vido❤

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

    easy to follow, great explanation. why cant i just store the decode json directly in the map?. i don't understand why the fromjson method is needed?

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

      as beginer in dart i just read it doc,that shown fromJson is one of Factory constructor method,
      Factory is class contructor that under main class which no produce instance like comons constuctor
      but hasa the return value if Facotry constructor make task order to subordinary class
      this fromJson method conver json format to object format ,i hope you will understand it
      on the above presentation Mr.dbestech i think mr.dBestech use the Factory constructor but forget to put infront of the Task class or formJson on the above mentioned as named Constructor ? :)))
      it should be like this : Factory Task.fromJson(Map json)
      but in this case mr.Dbestech use named constructor because not mentioned write factory,
      so the task in the above explanation is instance from named class :
      Task task = new Task..fromJson(args as json format)
      so from json = {"key1":value1, "key2":value2} become this : value1, value2 ( from method above0

  • @JohnPeter-bq6fp
    @JohnPeter-bq6fp 2 роки тому

    HI Sir, Ive been following your tutorial for some while now, I can say it has really helped me a lot.
    I have a question sir, I'm trying to build an app using firebase backend, in which a user(the host) can add another user(guest) to a role or task, and also keep track of the changes made by the added user
    can you please suggest how I can implement this... thank you sir!

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

      Hi Peter, thanks for commenting and asking. I am very familiar with firebase. So can not' help you much

    • @JohnPeter-bq6fp
      @JohnPeter-bq6fp 2 роки тому

      @@dbestech can you suggest any other approach?

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

    awesome, thanks
    (did you forget to key your "subscribe" motion graphics? 🧐)

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

      what do you mean?

    • @TheAkhileshDas
      @TheAkhileshDas Місяць тому

      @@dbestech By "keying", you can still maintain your lecture video visible underneath the Subscribe animation while its displayed, instead of green background.

    • @dbestech
      @dbestech  Місяць тому +1

      @@TheAkhileshDas ok. Thanks. There were solved in later videos

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

    Hi Bro,
    can you please do tutorials on php procedural, mysql and flutter
    big fan from India ❤️

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

      Why don't you follow Laravel tutorial e-commerce flutter app?

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

      @@dbestechi have created one entire e- commerce application with php procedural and mysql. I am searching for flutter with php procedural and mysql.
      Your videos are too good bro.
      I have to learn laravel from scratch ☹️☹️

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

    Wa alaikum salam

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

    what if the json has no keys and it is just values? like this: ["food", ""sleep", "rest, "breathe"].

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

      json should has key like dictionary,if as you mention above that is List type List :))

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

    0:46 bruh

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

    Salaam

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

      wa alaikum assalum

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

    No proper response from developer for my last comment

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

      Hi there, which comment?

  • @mostafa3wad205
    @mostafa3wad205 10 місяців тому

    وعليكم السلام

  • @HoangNguyen-bm4sn
    @HoangNguyen-bm4sn 2 роки тому

    share your fb group link pls

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

      facebook.com/groups/338913044520474