Created
March 8, 2020 08:53
-
-
Save plateaukao/0290169592b4e60b7002da98b3c896ad to your computer and use it in GitHub Desktop.
query google web app url and parse data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NetworkClient { | |
Future<List<VocabData>> getVocabs(VocabConfiguration vocabConfig) async { | |
final url = "https://script.google.com/macros/s/script_id_xxxxxxxxxx/exec"; | |
final response = await Dio().get( | |
url, | |
queryParameters: { | |
"id": vocabConfig.sheetId, | |
"range": vocabConfig.rangeName | |
} | |
); | |
List<VocabData> result = new List<VocabData>(); | |
for (int index = 0; index < response.data.length ; index ++) { | |
final item = response.data[index]; | |
result.add(VocabData(item[0], item[1], item[2], item[3])); | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment