feat: 修改bug
This commit is contained in:
@@ -429,7 +429,7 @@ class HIUserInfoView extends GetView<HIUserInfoController> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'设备:${_extractDeviceModel(userAgent)}',
|
||||
'设备:${_extractDeviceModel(userAgent, deviceType)}',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 10.sp, //
|
||||
@@ -589,12 +589,12 @@ class HIUserInfoView extends GetView<HIUserInfoController> {
|
||||
);
|
||||
}
|
||||
|
||||
String _extractDeviceModel(String deviceName) {
|
||||
String _extractDeviceModel(String deviceName, String deviceType) {
|
||||
// 匹配括号内内容
|
||||
final RegExp regExp = RegExp(r'\((.*?)\)');
|
||||
final Match? match = regExp.firstMatch(deviceName);
|
||||
|
||||
if (match != null && match.groupCount >= 1) {
|
||||
if (match != null && match.groupCount >= 1 ) {
|
||||
// 获取括号内内容
|
||||
final inside = match.group(1)!; // "Android; google Pixel 9; 15"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user