mirror of
https://github.com/immich-app/immich.git
synced 2026-04-06 09:12:03 -04:00
* fix: user-agent format * ci: fix static analysis --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
17 lines
414 B
Dart
17 lines
414 B
Dart
import 'dart:io' show Platform;
|
|
|
|
import 'package:package_info_plus/package_info_plus.dart';
|
|
|
|
Future<String> getUserAgentString() async {
|
|
final packageInfo = await PackageInfo.fromPlatform();
|
|
String platform;
|
|
if (Platform.isAndroid) {
|
|
platform = 'android';
|
|
} else if (Platform.isIOS) {
|
|
platform = 'ios';
|
|
} else {
|
|
platform = 'unknown';
|
|
}
|
|
return 'immich-$platform/${packageInfo.version}';
|
|
}
|