upgrade packages
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:device_info/device_info.dart';
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
|
||||
class DevInfo {
|
||||
bool? isAndroid;
|
||||
bool? isIOS;
|
||||
@@ -18,7 +19,7 @@ class DevInfo {
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
||||
_instance!.deviceID = androidInfo.androidId;
|
||||
_instance!.deviceID = androidInfo.id;
|
||||
_instance!.id = androidInfo.id;
|
||||
_instance!.model = androidInfo.model;
|
||||
} else if (Platform.isIOS) {
|
||||
|
||||
Reference in New Issue
Block a user