Non-nullable instance field 'articles' must be initialized. Try adding an initializer expression, or add a field initializer in this constructor, or mark it 'late'.
1 Answer
- Stack overflow questions should include code, not screenshots (imo);
- The IDE is literally giving you the tip you need. You're giving the
url
property a nullable value (and the same goes for other fields). Indeedjson['anything']
returns adynamic
value, which can be null.dynamic
values are runtime error-prone, I'd advise against its use.
My best advice would be to do a full Dart
language tour, in which you'll understand sound null safety a little better.