-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
468086c
commit 67f9732
Showing
14 changed files
with
553 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const fs = require('fs'); | ||
const dwn = require('../download-helper'); | ||
|
||
function startDownload() { | ||
var download_button = document.getElementById('download-button'); | ||
var urls; | ||
var downloadPath = "C:\\Android"; | ||
const progressIndicator = document.getElementById('progress-bar'); | ||
download_button.onclick = ''; | ||
download_button.classList.add("disabled"); | ||
dwn.getURLs('https://raw.githubusercontent.com/sampathbalivada/flutter_installer/master/urls.json?token=AGLFFNEZK75GHLTNLMTQOR26X57GO') | ||
.then((fetchedURLs) => { | ||
urls = fetchedURLs; | ||
showFileNames(urls); | ||
|
||
//Downloading Flutter SDK | ||
document.getElementById('sdk-loader').style.visibility = 'visible'; | ||
var finalPath = downloadPath + "\\" + dwn.getFilenameFromUrl(urls['flutter-sdk']); | ||
if (fs.existsSync(finalPath)) { | ||
return | ||
} | ||
return dwn.downloadFile({ | ||
remoteFile: urls['flutter-sdk'], | ||
localFile: finalPath, | ||
onProgress: function (received, total) { | ||
var percentage = (received * 100) / total; | ||
progressIndicator.value = percentage; | ||
} | ||
}) | ||
}) | ||
.then(() => { | ||
document.getElementById('sdk-loader').style.display = 'none'; | ||
document.getElementById('sdk-done').style.visibility = 'visible'; | ||
progressIndicator.value = 100; | ||
download_button.classList.remove("disabled"); | ||
download_button.innerHTML = 'Install Components'; | ||
download_button.setAttribute('onclick', 'sdkNextPage(1)'); | ||
}) | ||
} | ||
|
||
function showFileNames(urls) { | ||
document.getElementById('sdk-name').innerHTML += dwn.getFilenameFromUrl(urls['flutter-sdk']); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Flutter Installer</title> | ||
<script src="../../materialize/js/materialize.min.js"></script> | ||
<link rel="stylesheet" href="../app.css"> | ||
<script src="../app.js"></script> | ||
<script src="./download.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="titlebar"> | ||
<button class="topcorner" id="close-button" onclick="closeWindow()"> | ||
<i class="material-icons close-button">close</i> | ||
</button> | ||
</div> | ||
|
||
<div class="valign-wrapper" style="width: 100%; height: 80%;"> | ||
<div class="container" style="padding-top: 10%; height: 100%;"> | ||
<img src="../../assets/flutter_logo_lockup.svg" alt="Flutter Logo" style="height: 10%; margin-bottom: 2%;"> | ||
<div class="left-align"> | ||
<h5>The Flutter SDK will be downloaded:</h5> | ||
</div> | ||
<div class="left-align"> | ||
<ul> | ||
<li> | ||
<strong>Flutter SDK</strong> | ||
<div id="sdk-loader" class="loader"></div> | ||
<i id="sdk-done" class="material-icons completion-icon">done</i> | ||
<p id="sdk-name" style="font-style: italic;">version: </p> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
</div> | ||
|
||
</div> | ||
<div class="row center-align"> | ||
<a id="download-button" href="javascript:void(0)" onclick="startDownload()" | ||
class="waves-effect waves-light light-blue darken-1 btn">Start Download</a> | ||
</div> | ||
<!-- <p style="position: absolute; left: 10px; bottom: 1%;">80%</p> --> | ||
<progress id="progress-bar" max='100' value='0'></progress> | ||
|
||
</body> | ||
|
||
</html> |
Oops, something went wrong.