upgrade packages

This commit is contained in:
2024-01-23 14:35:09 +06:30
parent e99689a10d
commit dde24bb248
10 changed files with 752 additions and 420 deletions

View File

@@ -2,7 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:device_info/device_info.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:dio/dio.dart';
import 'package:fcs/domain/vo/status.dart';
import 'package:logging/logging.dart';
@@ -65,7 +65,7 @@ Future<dynamic> requestDownloadAPI(String path, method,
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
String deviceName = "${androidInfo.model}(${androidInfo.id})";
log.info("device:${androidInfo.androidId},deviceName:$deviceName");
log.info("device:${androidInfo.id},deviceName:$deviceName");
var bytes = utf8.encode(payload);
var base64Str = base64.encode(bytes);
@@ -84,9 +84,8 @@ Future<dynamic> requestDownloadAPI(String path, method,
if (token != null) {
request.headers.set("Token", token);
}
if (androidInfo.androidId != null) {
request.headers.set("Device", androidInfo.androidId + ":" + deviceName);
}
request.headers.set("Device", androidInfo.id + ":" + deviceName);
request.headers.set("payload", escapePayload);
var response = await request.close();
print("headers:${response.headers}");
@@ -107,7 +106,7 @@ Future<dynamic> requestDownloadPDFAPI(String path, method,
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
String deviceName = "${androidInfo.model}(${androidInfo.id})";
log.info("device:${androidInfo.androidId},deviceName:$deviceName");
log.info("device:${androidInfo.id},deviceName:$deviceName");
var bytes = utf8.encode(payload);
var base64Str = base64.encode(bytes);
@@ -124,9 +123,8 @@ Future<dynamic> requestDownloadPDFAPI(String path, method,
if (token != null) {
request.headers.set("Token", token);
}
if (androidInfo.androidId != null) {
request.headers.set("Device", androidInfo.androidId + ":" + deviceName);
}
request.headers.set("Device", androidInfo.id + ":" + deviceName);
request.headers.set("payload", escapePayload);
var response = await request.close();
print("headers:${response.headers}");
@@ -157,7 +155,7 @@ Future<dynamic> requestDownload(String path, method,
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
String deviceName = "${androidInfo.model}(${androidInfo.id})";
log.info("device:${androidInfo.androidId},deviceName:$deviceName");
log.info("device:${androidInfo.id},deviceName:$deviceName");
var bytes = utf8.encode(payload);
var base64Str = base64.encode(bytes);
@@ -173,9 +171,8 @@ Future<dynamic> requestDownload(String path, method,
if (token != null) {
request.headers.set("Token", token);
}
if (androidInfo.androidId != null) {
request.headers.set("Device", androidInfo.androidId + ":" + deviceName);
}
request.headers.set("Device", androidInfo.id + ":" + deviceName);
request.headers
.set(HttpHeaders.contentTypeHeader, 'application/json; charset=utf-8');
request.headers.set("payload", escapePayload);