Browse Source

fix device info exception

pull/18/head
Sun 4 years ago
parent
commit
d15d574c0f
  1. 2
      lib/pages/account_quick.dart
  2. 12
      lib/utils/device_info.dart

2
lib/pages/account_quick.dart

@ -177,7 +177,7 @@ class _AccountQuickPageState extends State<AccountQuickPage> { @@ -177,7 +177,7 @@ class _AccountQuickPageState extends State<AccountQuickPage> {
shape: CircleBorder(),
),
child: Icon(Icons.add_circle,
size: 32.0, color: color.primary),
size: 32.0, color: Color(0xFF6174FF)),
),
onTap: () => selectAvatar(context, (bytes) => setState(() {
_imageBytes = bytes;

12
lib/utils/device_info.dart

@ -13,7 +13,7 @@ Future<List<String>> deviceInfo() async { @@ -13,7 +13,7 @@ Future<List<String>> deviceInfo() async {
"Web",
data.platform!
];
} on PlatformException {
} catch (_e) {
return ["Web", "Web Unknown"];
}
} else {
@ -24,7 +24,7 @@ Future<List<String>> deviceInfo() async { @@ -24,7 +24,7 @@ Future<List<String>> deviceInfo() async {
data.brand!,
data.id!,
];
} on PlatformException {
} catch (_e) {
return ["Android", "Android Unknown"];
}
} else if (Platform.isIOS) {
@ -34,7 +34,7 @@ Future<List<String>> deviceInfo() async { @@ -34,7 +34,7 @@ Future<List<String>> deviceInfo() async {
data.name!,
data.utsname.machine!,
];
} on PlatformException {
} catch (_e) {
return ["IOS", "IOS Unknown"];
}
} else if (Platform.isLinux) {
@ -44,7 +44,7 @@ Future<List<String>> deviceInfo() async { @@ -44,7 +44,7 @@ Future<List<String>> deviceInfo() async {
data.name,
data.prettyName,
];
} on PlatformException {
} catch (_e) {
return ["Linux", "Linux Unknown"];
}
} else if (Platform.isMacOS) {
@ -54,7 +54,7 @@ Future<List<String>> deviceInfo() async { @@ -54,7 +54,7 @@ Future<List<String>> deviceInfo() async {
data.hostName,
data.computerName,
];
} on PlatformException {
} catch (_e) {
return ["MacOS", "MacOS Unknown"];
}
} else if (Platform.isWindows) {
@ -64,7 +64,7 @@ Future<List<String>> deviceInfo() async { @@ -64,7 +64,7 @@ Future<List<String>> deviceInfo() async {
'Windows',
data.computerName,
];
} on PlatformException {
} catch (_e) {
return ["Windows", "Windows Unknown"];
}
}

Loading…
Cancel
Save