Working With JSON In Dart + Flutter - 25 Days Of Flutter

preview_player
Показать описание
Learn how to handle basic json in dart and flutter.

🎒 My Gear 🎒

📧 Connect with me 📧

#flutter25
Рекомендации по теме
Комментарии
Автор

hi benjamin thank you but how we can write the data on the text i cannot do it

fatihsertacyildirim
Автор

What would be the cost if we avoided using factory constructor?

orjihvy
Автор

I got this problem 'The parameter 'password' can't have a value of 'null' because of its type, but the implicit default value is 'null'.
Try adding either an explicit non-'null' default value or the 'required' modifier' when when initializing Accounts({this.userName, this.password});

Here's my code:

class Accounts {
String userName;
String password;

Accounts({this.userName, this.password});

factory Accounts.fromJson(Map<String, dynamic> json) {
return Accounts(
userName: json['username'],
password: json['password'],
);
}
}

KhoiNguyen-jtmr