-2

1

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
  • make the URL late to make it non-nullable
    – programmer
    Sep 15, 2021 at 22:31

1 Answer 1

3
  1. Stack overflow questions should include code, not screenshots (imo);
  2. 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). Indeed json['anything'] returns a dynamic 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.