Flutter sample

Hello,
I’m learning the product and the sample not working
await widget.amityPost
.edit()
.text(text)
.image(attachments)- The method ‘image’ isn’t defined for the type ‘AmityTextPostEditorBuilder’
.metadata(metadata)
.mentionUsers(mentionUsers.map((e) => e.userId!).toList())
.build()
.update();

Hello, to assist you better, could you please provide us with more details about what you are trying to achieve? Also, could you please provide information about the error or issue you are currently facing when you mentioned that it’s not working?

Thanks for the quick reply.
I’m learning Amity social product.
Downloaded the Flutter sample, to my Android Studio + mobile device.
I changed the following line in pubspec.yaml
amity_sdk:
path: …/Amity-Social-Cloud-SDK-Flutter-Internal
to
amity_sdk: ^0.21.0

Pub get was OK
But in the file update_post_screen.dart
I have 3 errors on await widget.amityPost

    await widget.amityPost
        .edit()
        .text(text)
        .image(attachments)
        .metadata(metadata)
        .mentionUsers(mentionUsers.map((e) => e.userId!).toList())
        .build()
        .update();

  await widget.amityPost
      .edit()
      .text(text)
      .file(attachments)
      .metadata(metadata)
      .mentionUsers(mentionUsers.map((e) => e.userId!).toList())
      .build()
      .update();

  await widget.amityPost
      .edit()
      .text(text)
      .video(attachments)
      .metadata(metadata)
      .mentionUsers(mentionUsers.map((e) => e.userId!).toList())
      .build()
      .update();

The error
The method ‘image’ isn’t defined for the type ‘AmityTextPostEditorBuilder’. (Documentation) Try correcting the name to the name of an existing method, or defining a method named ‘image’.

Currently, updating images in an image post is not yet supported in Flutter. This limitation is documented in our Flutter documentation at the following link: https://docs.amity.co/social/posts/create-post/image-post

1 Like

Thanks I will remove it and try again

Thanks It is working

1 Like