Search code examples
flutterparse-platformback4app

Problem with Getting object from class of back4app database FLUTTER ONLY


I'm getting dumb with this

Future Object1() async{
final object1 = await ParseObject('Announcement')..objectId='vG1WZeVHkV';
var mal = await object1.get('an1');
await print(mal);

}

just in case you ask the result for that

I/flutter ( 9123): null

when I was hoping for this url (it is a file column in back4app for image)

"an1":{"__type":"File","name":"6c128c064142552b8c3a5e2ac016bc1d_1.jpg","url":"https://parsefiles.back4app.com/nQ1FGO9uklC7f9eMKYDuA16pvAjamCYnbI6xD2Zy/6c128c064142552b8c3a5e2ac016bc1d_1.jpg"}

(note I got this from using object1.fetch() )

so can anyone help me???


Solution

  • It should be:

    Future Object1() async {
      final object1Response = await ParseObject('Announcement').getObject('vG1WZeVHkV');
      if (object1Response.success) {
        final object1 = object1Response.result;
        var mal = await object1.get('an1');
        print(mal);
      }
    }