Тёмный

Flutter Convert JSON to Dart Model Classes 

Coding Orbit
Подписаться 4 тыс.
Просмотров 16 тыс.
50% 1

Hey Guys, in this Flutter video you will learn how to convert json to dart model classes and objects. You will learn how to parse json to dart models manually and automatically, by using a flutter json serializable library.
You will learn how to deal and parse simple json objects to dart models and then how to parse complex json objects to dart models and objects as well.
We will use json_serializable library to implement the automatic part.
For more Flutter content be sure to subscribe to the channel and turn on your notifications.
check out my Flutter tutorial to become Flutter hero: • Flutter Tutorial for B...
Links:
Don't click this: bit.ly/3dkJUNB
Pub dev library: pub.dev/packages/json_seriali...
Library example: github.com/google/json_serial...
GitHub Source code: github.com/Coding-Orbit/flutt...
-------- Content of this video --------
00:00 Intro
00:32 Manual JSON conversion
04:43 Automatic JSON conversion
#flutter #flutter_json #flutter_json_serializable #flutter_json_to_model

Опубликовано:

 

3 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@orjiemmanuel6442
@orjiemmanuel6442 2 года назад
Awesome straight to the point
@codingorbit
@codingorbit 2 года назад
Thank you
@sanketbhagat1222
@sanketbhagat1222 2 года назад
Great Content. Keep going on!
@codingorbit
@codingorbit 2 года назад
Thank You!
@amm9653
@amm9653 2 года назад
As usual, great video
@codingorbit
@codingorbit 2 года назад
Thank you
@josephbelhadj193
@josephbelhadj193 2 года назад
Very helpful thank you so much
@codingorbit
@codingorbit 2 года назад
My pleasure!
@abiliolutz8528
@abiliolutz8528 Год назад
Nice tutorial, thanks for share, cheers from Brazil
@codingorbit
@codingorbit Год назад
Thank you man glad you liked it
@josealirioyepesmolina
@josealirioyepesmolina Год назад
congratulations, the video and info excellent for dummies, i not listen english only view all video, perfect the use tools for create automatic json to model class, the time speed. ufff You have how to, ? create automatic the folder and dowloand json url or api rest and save local folder, save data or update data to filejson and send file json to sample api
@codingorbit
@codingorbit Год назад
Glad you liked it!
@lukas7338
@lukas7338 Год назад
great topic, great explaination. why are these needed? and why factory only for "fromjson"?
@codingorbit
@codingorbit Год назад
They are needed to convert your model from and to json format to make api calls but its not required to be generated you could type it yourself
@911christophe
@911christophe 2 года назад
thanks mister
@codingorbit
@codingorbit 2 года назад
Most welcome ☺️
@hasnatshahzad4573
@hasnatshahzad4573 2 года назад
Please make a video on flutter package dio post form data to api. Its humble request. Thank you
@codingorbit
@codingorbit 2 года назад
Yeah maybe soon.
@mawahebk
@mawahebk Месяц назад
i m new to Flutter and i found that it is super super complex and inefficient to write all this code with so many repetition for the fields .... JSON import should be easy, apparently not in flutter!
@vibhor691
@vibhor691 2 года назад
Hello, can you please tell me what is the need of coverting json to dart objects rather than directly getting the data as a list of Maps or Maps directly and using it . Please answer
@codingorbit
@codingorbit 2 года назад
Most APIs use json or xml formats so when you call an API you’re most likely expecting a json result and json actually looks like a map so you can use it as a map and if there is list so you can use a list of maps but that isn’t a good practice since relying on maps that much might cause errors and its hard to develop. Let’s say we got a result and we named it result and this result has another map called data and under data you have a name so you would write result[“data”][“name”] while if your using models with the same names you would type result.data.name knowing that if you have typing error using maps it wouldn’t appear unless you run the app but if your using models it would appear immediately if you wrote names instead of name so names isn’t recognised. Besides models are easy to use and handle
@vibhor691
@vibhor691 2 года назад
@@codingorbit thankyou so much for explaining in detail. God bless you ❤
@codingorbit
@codingorbit 2 года назад
My pleasure!
@RoCr7naldo
@RoCr7naldo Год назад
Good tutorial please can I do the same with frommap 🙏
@codingorbit
@codingorbit Год назад
Sure thing it does that for frommap as from json
@qussaiqassim9912
@qussaiqassim9912 2 года назад
👍🏾
@RattzMusic
@RattzMusic 2 года назад
Good video
@codingorbit
@codingorbit 2 года назад
Thank you!
@RattzMusic
@RattzMusic 2 года назад
@@codingorbit I have one questions have you ever use stacked architecture?
@codingorbit
@codingorbit 2 года назад
No I haven’t
@kamalmatensa708
@kamalmatensa708 2 года назад
❤‍🔥❤‍🔥❤‍🔥
Далее
Flutter Sidebar | Navigation Drawer
11:45
Просмотров 15 тыс.
ELA NÃO ESPERAVA POR ISSO 🥶 ATTITUDE #shorts
00:20
Просмотров 981 тыс.
Китайка и Шрек в Домике😂😆
00:20
Converting JSON to Dart Classes
13:03
Просмотров 21 тыс.
What is happening with Flutter
3:41
Просмотров 145 тыс.
Flutter Local Notifications
18:49
Просмотров 42 тыс.
REST Call with Flutter - Http methods
19:55
Просмотров 69 тыс.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
ELA NÃO ESPERAVA POR ISSO 🥶 ATTITUDE #shorts
00:20
Просмотров 981 тыс.