mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-06-06 05:49:03 +08:00
18 lines
403 B
Dart
18 lines
403 B
Dart
import 'package:ua_parser_js/ua_parser_js.dart';
|
|
|
|
final _uaParser = UAParser();
|
|
String? _device;
|
|
|
|
Future<String?> get device {
|
|
if (_device == null) {
|
|
final ua = _uaParser.getResult();
|
|
_device = ua.browser.name;
|
|
if (_device != null && _device!.isNotEmpty) {
|
|
_device = "$_device ${ua.browser.version}";
|
|
}
|
|
}
|
|
return Future.value(_device);
|
|
}
|
|
|
|
String? get clientPlatform => "web";
|