mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
add login client type
This commit is contained in:
17
lib/platform/device_web.dart
Normal file
17
lib/platform/device_web.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:ua_parser_js/ua_parser_js.dart';
|
||||
|
||||
final _uaParser = UAParser();
|
||||
String? _device;
|
||||
|
||||
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 _device;
|
||||
}
|
||||
|
||||
String? get clientPlatform => "web";
|
||||
Reference in New Issue
Block a user