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
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.
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????
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!
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
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)
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
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
I have the same problem. I can't fix it
@@swalihvmbazar2207 Me too
@@swalihvmbazar2207 see this:
flutter.dev/docs/development/data-and-backend/json
Finally understood this 😌.Was stuck at this from 2days but you finally saved me n my code😄🙏🏻
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.
Hello. Ho do I go about using this "part of" and "part". Its never works fine here.
Thank you, what is this theme? I like it.
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????
ruclips.net/video/8fFoLs9qVQA/видео.html may hep you
Thank you so much for your great effort
when i try to add the command ,
this is what I get >> bash: flutter: command not found
you may need to run flutter pub get before the build_runner command
The tutorial is awsomee
Wow, thanks!
I couldn't the error disappear part 'Message.g.dart'; please help me
cant create the file '...g.dart. the vscode doesnt recognize the flutter name in the cmdlet
Anda a lavar taper vos
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!
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
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)
Your IDE looks attractive (Font color), Please share your VS extensions with us.
@@zaisteprogramming Thanks
Jayesh Lathiya where you able to find the extension?
I needed to migrate the project to AndroidX for the build_runner step to work
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
voice are so beatiful
thanks vry much again
plz put some more light on it
if you could
Dart data class Sniped for va Code do the same
This library github.com/k-paxian/dart-json-mapper has even less boilerplate and more features