将谷歌工作表中的数据显示到颤振数据表

问题描述

我在谷歌表格中有一个简单的表格(见附图) 我想在颤振数据表或分页数据表中实时显示

enter image description here

Flutter 连接到 gsheets

import 'package:gsheets/gsheets.dart';

我的谷歌身份验证凭据

const _credentials = r'''
{
  "type": "service_account","project_id": "gsheets-313800","private_key_id": "c0a6ca8df989dcf304e5648eacc857f08959ed28","private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC8LwKdioSvoUCt\nx8wf1S+SbqQivIKbhoNV499zNxSOwMPx8hCZy8+WxkG4TfW5Pn18Ymy5Gfpzzi8r\nXb0IZKOGueqkiximsBQQzRiiOMVmFlWvmXNsBKB4+J3s1R+4dmYjMYRn/8D2DLPm\nRpZQqcx5gSC4K8nU3GQJzCN/z/tGcnU8Gr8rK5E49Z9gt/Dj944Nfgd83bzvHBJg\nlqFMARTV44G5Zxb6HAL/TgEfBKyMLoPcYzqw7DPB9UTvjAl1oXC0YN+4LGtpNPq9\nzcpT8DQc5RstT9g/Rfo91HbSRJmG3GklN+4Ltwi8gEIeXyuzBB/tE4z89xbOvwNk\nHqhcgFz/AgMBAAECggEAMZqGo//4p97uiKBAyydLueKWO13LY6mKVwqQ7PLY5WQk\nglMXUyLpHko2KpnKKsExHKdpF0Wkwf/YaSr1WBAHFs1M74CGwRbswxz84E3soqNC\nhN4DEbcKgbivEC2BhgMXmzFDQJKmz3S7uvhiSPLpJiIGeOV59zT83aREuz0cdA3l\ngicQFjcrCRw2MGsdRSSUED2J4k0BLGJ1+gQi83OWJSiu0Dj0JZAteXJeZlXhhnvk\nPdr6k+aYyMEttfCNQILBpYF8zXaW0MjSoeHy+DVxpc3V6maCu7od+zbFoWCPxJsN\nPkKeq9fOg2na+qCjA6WMCtTAaitpPVh1+q5ygoFDcQKBgQDuionPPY5swojc+vv9\nP6jtyFtzdlb5liA9S73KzCm3+sr0oMH/zh5RW6MeLcE9EcjjYd+5lQQpg70P3y/S\nsmMSuarTWProLFd8mHtaTZ3Q6wGayp4NYKfkcfMjFCh1ui6z1KZC6xLb1pV6RDcN\nvRKiVwrWGxrqp7cKTj9G/E9deQKBgQDJ9PCuDZrAudVRimRiXcd801DAsVF3cDm5\n9JWLefM6hhTNZdODZyTgA4yoZYPe+L0Mf66qfFi23ZWxsNjiWiV7xtPUhPYkqB3N\nLjCm+Lpj4jbQJzvjwx2qOhfwFPoGLHUDOpvwai5yeHUvbjhVnfgD/V7mDXmp8Mwz\n5n1VmGOINwKBgQCWawnHgvuCnZEMN8Aay7/MYWE5h9AEhqRBwrclYGSWPTEp3Q04\nL1Ny3iQX7aZCyioxKBCZx9veCdJ4ZbaUWCSdNDMCHsPpD70DNmvix7s6eFaEs2vC\n58YmpIA7CIUS55p3j4pf/DfiJIgRl15X7XgIonaU2Ha6rZOAjiLcslGhkQKBgQCG\nGcPa/yOcB4lzHH7tpjG5XCPJ37Qlp/pc1OCb/b0ZRkD35j5diZa9vP2gL9AxtV7q\ntrnHcMwDmP02QSSyoIM1PmAYRLWgv5USUjJyHMS/YE1fSD4HTd8b0nlkrLkccla8\nbyVurULsNboyZXC4wS0XkR17isUXp9IgQFNHC+pDXwKBgQCLID/N29A4+WBEx8Dd\nJV3lW9TKqollLYvt4AWdPHdEj6kfXOcU9YICjHv3G9RL5NQgaBttuuA6ckPA1TXf\nAho+bnh5MfeZtee6RRphcgPInKFfBYSUz4/LnJGdSxGQY23gieapg3FanmkfQgDK\nLBl6CEVq/q9KwBqrhj8tOZvbDQ==\n-----END PRIVATE KEY-----\n","client_email": "gsheets@gsheets-313800.iam.gserviceaccount.com","client_id": "117734640305286546886","auth_uri": "https://accounts.google.com/o/oauth2/auth","token_uri": "https://oauth2.googleapis.com/token","auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url": "https://www.googleapis.com/robot/v1/Metadata/x509/gsheets%40gsheets-313800.iam.gserviceaccount.com"
}
''';

我的电子表格 ID

const _spreadsheetId = '1wSzyim3aI97j388BIgm5JYEwD56BJxkE2IX-6D13cgM';

void main() async {
  // init GSheets
  final gsheets = GSheets(_credentials);
  // fetch spreadsheet by its id
  final ss = await gsheets.spreadsheet(_spreadsheetId);
  // get worksheet by its title
  var sheet = ss.worksheetByTitle('test');
  // create worksheet if it does not exist yet
  sheet ??= await ss.addWorksheet('test');

  print(await sheet.values.column(1));


}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)