You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
519 B
Dart

import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:isekai_wiki/global.dart';
import '../extension/string.dart';
class ApiUtils {
static Future<String> getUserAgent() async {
if (kIsWeb) {
// Web版防止出错
return "";
}
String osName = Platform.operatingSystem.capitalize();
String osVersion = Platform.operatingSystemVersion;
String appVersion = Global.packageInfo?.version ?? "0.0";
return "IsekaiWikiApp/$appVersion ($osName $osVersion)";
}
}