add login client type

This commit is contained in:
2024-02-02 13:14:25 +08:00
parent 6608c0b94e
commit 23abc091ea
12 changed files with 221 additions and 2 deletions

View 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";