This file contains hidden or 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
| import 'package:flutter/services.dart'; | |
| Future<String> saveFile(String mime, String name, String data) async { | |
| const platform = | |
| MethodChannel("com.msvcode.filesaver/save"); //unique channel identifier | |
| try { | |
| final result = await platform.invokeMethod("saveFile", { | |
| "mime": mime, | |
| "name": name, | |
| "data": data, |
This file contains hidden or 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
| // Written by MSVCode on GitHub | |
| // Based on https://www.qrcode.com/en/about/version.html | |
| // Array of Map, example code compatible with JS, TS, and Dart. | |
| const qrBits = [ | |
| {"L":152, "M":128, "Q":104, "H":72}, //1 | |
| {"L":272, "M":224, "Q":176, "H":128}, | |
| {"L":440, "M":352, "Q":272, "H":208}, | |
| {"L":640, "M":512, "Q":384, "H":288}, | |
| {"L":864, "M":688, "Q":496, "H":368}, //5 |
This file contains hidden or 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
| const google = require('googleapis'); | |
| const customsearch = google.customsearch('v1'); | |
| const CX = 'your_custom_search_engine_key'; //https://cse.google.com/ | |
| const API_KEY = 'your_cse_api_key'; //https://developers.google.com/custom-search/json-api/v1/overview | |
| function runSearchQuery(query, startFrom){ | |
| return new Promise(function(resolve,reject){ | |
| customsearch.cse.list({ cx: CX, q: query, auth: API_KEY, start:startFrom}, function (error, response) { | |
| if (error) reject(error); | |
| resolve(response.items); |