Struggling to retrieve JSON data using custom classes

Hello,

I’m following the Flutter SDK instructions on how to retrieve JSON using custom classes, but keep getting an error and have been stuck, hope you can point out where I’m going wrong. I want to be able to do exhibit.images?.imageList?[0].url for example.

I have the following classes:

@reflector
class Exhibit {
  late JsonImageList? images;
}

@reflector
class JsonImageList {
  List<ImageObject>? imageList;
}

@reflector
class ImageObject {
  String? url;
  String? copyrightText;
  String? altText;
  String? name;
}

This is the shape of my data:

{
  "imageList": [
    {
      "url": "loooorem_url",
      "name": "art_thing",
      "altText": "Something",
      "copyright": "beep"
    },
    {
      "url": "lorem_ipsum",
      "name": "art_thing_2",
      "altText": "Something else",
      "copyright": "boop"
    }
  ]
}

The column in my table is called images.

But I keep getting the following error:
Screenshot 2023-04-27 at 22.37.16

Hello, @Ilayda_B.

Which one version of flutter-sdk are you using?

Regards, Nikita.

Hello,

I’m using backendless_sdk: ^7.2.3.

Ok, thank you. I Will investigate this issue.