Created
September 8, 2021 10:24
-
-
Save suinua/7b701682f9e3a761a61afd2738427ca7 to your computer and use it in GitHub Desktop.
dart ファイルをダウンロードさせる
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
void download(String text) { | |
String encodedFileContents = Uri.encodeComponent(text); | |
//text file | |
new AnchorElement(href: "data:text/plain;charset=utf-8,$text") | |
..setAttribute("download", "manifest.json") | |
..click(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment