Flutter in Practice - E07: Automatic JSON Serialization

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

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

  •  4 года назад +11

    hi. the [ part 'Message.g.dart'; ] needs to be [ part 'message.g.dart'; ] in lowercase naming convention. I found about that by trial and error method. Thx

    • @swalihvmbazar2207
      @swalihvmbazar2207 4 года назад

      I have the same problem. I can't fix it

    • @anarbek7597
      @anarbek7597 4 года назад

      @@swalihvmbazar2207 Me too

    • @anarbek7597
      @anarbek7597 4 года назад

      @@swalihvmbazar2207 see this:
      flutter.dev/docs/development/data-and-backend/json

  • @rutviktak716
    @rutviktak716 4 года назад

    Finally understood this 😌.Was stuck at this from 2days but you finally saved me n my code😄🙏🏻

  • @Kolano666
    @Kolano666 4 года назад

    To anyone wondering how to create toJson at the same time after using json_annotation, add getter to your class like this:
    Map get toJson => _$ClassNameToJson(this);
    where _$ClassNameToJson is function generated in class_name.g.dart file.

  • @manoeltsf
    @manoeltsf 4 года назад

    Hello. Ho do I go about using this "part of" and "part". Its never works fine here.

  • @ahmed_alharthi
    @ahmed_alharthi 4 года назад

    Thank you, what is this theme? I like it.

  • @pradeep422
    @pradeep422 5 лет назад +1

    Hi ty for videos, got a question: I hav map of 2 maps, the 2nd map inside consists of list of map I need how do u approach this.. use jso serialization or built values from dart????

  • @sunaarun6603
    @sunaarun6603 5 лет назад

    Thank you so much for your great effort

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

    when i try to add the command ,
    this is what I get >> bash: flutter: command not found

  • @samario_torres
    @samario_torres 4 года назад

    you may need to run flutter pub get before the build_runner command

  • @Nobody-ky7sl
    @Nobody-ky7sl 5 лет назад

    The tutorial is awsomee

  • @augustoeduardo209
    @augustoeduardo209 4 года назад

    Wow, thanks!

  • @swalihvmbazar2207
    @swalihvmbazar2207 4 года назад

    I couldn't the error disappear part 'Message.g.dart'; please help me

  • @DJSacudimeelcarancho
    @DJSacudimeelcarancho 4 года назад

    cant create the file '...g.dart. the vscode doesnt recognize the flutter name in the cmdlet

  • @sreid70
    @sreid70 5 лет назад

    At 0:31 line 19 you show the return value of the loadMessageList function declaration to be a Future. Shouldn't this be void? loadMessageList doesn't return anything. It just calls setState() and sets messages = _messages. Not picking, just trying to understand. Great videos!

    • @hikryon
      @hikryon 4 года назад

      You can write Future but is the same (if I wrong plz correct me).
      On other hand, loadMessageList works with async data and how do you not know when you will finish receiving the information, you need indicates to flutter/dart this function in the future will end with success or error result, similar to promises in js.
      More info (and maybe better explained):
      dart.dev/codelabs/async-await
      api.dart.dev/stable/2.7.1/dart-async/Future-class.html

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

    for someone who still can not generate "message.g.dart".
    the file name need to be the same.
    For example:
    the file of Message model class is message_model.dart
    and you wrote: part 'message.g.dart'; .It will NOT WORK.
    you need to change to : part 'message_model.g.dart';
    and then run: flutter pub run build_runner build
    and Voila, working :o)
    So depend on the name of model class dart file name. Be careful :o)

  • @JayeshLathiya77
    @JayeshLathiya77 5 лет назад

    Your IDE looks attractive (Font color), Please share your VS extensions with us.

    • @JayeshLathiya77
      @JayeshLathiya77 5 лет назад

      ​@@zaisteprogramming Thanks

    • @ahmed_alharthi
      @ahmed_alharthi 4 года назад

      Jayesh Lathiya where you able to find the extension?

  • @sumosnow
    @sumosnow 5 лет назад

    I needed to migrate the project to AndroidX for the build_runner step to work

  • @mrpakravian
    @mrpakravian 5 лет назад +1

    may be with a nested json
    with double dimensional array
    like data grouped by date
    and dispaying with sticky headers
    also to map function and then to list is been very confusing
    if possible pl adress those issues
    i hope i am not asking too much

  • @baidutaobao5186
    @baidutaobao5186 4 года назад

    voice are so beatiful

  • @mrpakravian
    @mrpakravian 5 лет назад

    thanks vry much again
    plz put some more light on it
    if you could

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

    Dart data class Sniped for va Code do the same

  • @AlexanderMazuruk
    @AlexanderMazuruk 4 года назад

    This library github.com/k-paxian/dart-json-mapper has even less boilerplate and more features