2023-10-30 20:39:31 +08:00
|
|
|
import 'package:dio/dio.dart';
|
2023-11-05 15:56:48 +08:00
|
|
|
import 'package:flutter/foundation.dart';
|
2023-10-30 20:39:31 +08:00
|
|
|
import 'package:starcitizen_doctor/common/conf.dart';
|
|
|
|
import 'package:starcitizen_doctor/common/utils/base_utils.dart';
|
|
|
|
|
|
|
|
class AnalyticsApi {
|
|
|
|
static final Dio _dio = Dio();
|
|
|
|
|
|
|
|
static touch(String key) async {
|
2023-11-05 15:56:48 +08:00
|
|
|
// debug 不统计
|
|
|
|
if (kDebugMode) return;
|
2023-10-30 20:39:31 +08:00
|
|
|
dPrint("AnalyticsApi.touch === $key start");
|
|
|
|
try {
|
|
|
|
await _dio.post("${AppConf.xkeycApiUrl}/analytics/$key");
|
|
|
|
dPrint("AnalyticsApi.touch === $key over");
|
|
|
|
} catch (e) {
|
|
|
|
dPrint("AnalyticsApi.touch === $key Error:$e");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|