Search code examples
fluttergoogle-apps-scriptgoogle-sheetsfile-upload

Flutter gsheets: How to upload image


I working on a Flutter project, where I get/set values from a Google sheet document. For this I use the gsheets 0.4.2 package, which works very well. But now I want to upload images to specified cells but I don't know how.

I'm using this code to update the cells:

static Future updateCell({
    required String idobelyeg,
    required String key,
    required dynamic value,
  }) async {
    if (_userSheet == null) print("NOT Done");

    return _userSheet!.values
        .insertValueByKeys(value, columnKey: key, rowKey: idobelyeg)
        .then((value) {
      print("Done");
    });
  }

Can I upload images to my document with this package, if yes, how can I do that? If the answer is no, how can I upload image to my document?


Solution

  • Depends on what Database you're using but the only way to manage this is to store the image directly to your Database eg. Firebase and it automatically generates you a link URL to that image so you possibly can pass and insert it to your Googlesheets after that.