download method

Future download()

Download the current selection

Implementation

Future download() async {
  if (kDebugMode) {
    print("downloading...");
  }

  // Load data from git repo
  try {
    for (var i = 0; i < selectedList.length; i++) {
      String name = selectedList[i].name;
      // Get Script
      Response<dynamic> contentFile =
          await Dio().get('$repoScripts/$name/script.noshell');
      QuickActionItem item = selectedList[i];
      item.content = contentFile.data.toString();
      QuickAction.addToPrefs(item);
    }
  } catch (err) {
    if (kDebugMode) {
      print(err);
    }
    Notify.message('errordownloading-text'.i18n());
  }
}