cleanup code
This commit is contained in:
@@ -27,7 +27,7 @@ Future<dynamic> requestAPI(String path, method,
|
||||
if (token != null) {
|
||||
headers["Token"] = token;
|
||||
}
|
||||
if (devInfo != null && devInfo.deviceID != null && deviceName != null) {
|
||||
if (devInfo.deviceID != null) {
|
||||
headers["Device"] = devInfo.deviceID ?? "" + ":" + deviceName;
|
||||
}
|
||||
headers["Project-ID"] = Config.instance.reportProjectID;
|
||||
@@ -148,8 +148,8 @@ typedef OnDownloadDone(File file);
|
||||
// if token is null
|
||||
Future<dynamic> requestDownload(String path, method,
|
||||
{dynamic payload,
|
||||
required String token,
|
||||
required String url,
|
||||
required String? token,
|
||||
required String? url,
|
||||
required String filePath,
|
||||
OnDownloadDone? onDownloadDone}) async {
|
||||
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
||||
@@ -187,7 +187,7 @@ Future<dynamic> requestDownload(String path, method,
|
||||
fileName = cd.substring(cd.indexOf("=") + 1);
|
||||
}
|
||||
|
||||
var file = filePath + "/" + fileName;
|
||||
// var file = filePath + "/" + fileName;
|
||||
var fileSave = new File(filePath + "/" + fileName);
|
||||
response.listen((d) => _downloadData.addAll(d), onDone: () async {
|
||||
await fileSave.writeAsBytes(_downloadData);
|
||||
|
||||
Reference in New Issue
Block a user