init method

void init(
  1. List<PickedAssetModel> filePath,
  2. String userName,
  3. ProfileDetails profile,
  4. String textMessage,
  5. bool showAdd,
  6. bool isFromGalleryPicker,
)

Implementation

void init(
    List<PickedAssetModel> filePath,
    String userName,
    ProfileDetails profile,
    String textMessage,
    bool showAdd,
    bool isFromGalleryPicker) {
  this.userName = userName;
  this.profile(profile);
  this.filePath(filePath);
  this.textMessage = textMessage;
  this.showAdd = showAdd;
  this.isFromGalleryPicker = isFromGalleryPicker;
  SchedulerBinding.instance.addPostFrameCallback((_) {
    // filePath(Get.arguments['filePath']);
    var index = 0;
    for (var _ in filePath) {
      if (index == 0) {
        captionMessage.add(textMessage);
        index = index + 1;
      } else {
        captionMessage.add(Constants.emptyString);
      }
    }
  });
  caption.text = textMessage;
  captionFocusNode.addListener(() {
    if (captionFocusNode.hasFocus) {
      showEmoji(false);
    }
  });
}