simplified code across the app and consolidated duplicated helpers
This commit is contained in:
@@ -5,6 +5,7 @@ import 'dart:typed_data';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
import '../../client_platform.dart';
|
||||
import '../../marianumconnect_query.dart';
|
||||
|
||||
/// Submits user feedback to MarianumConnect (`POST me/feedback`, bearer-auth).
|
||||
@@ -27,7 +28,7 @@ class SubmitFeedback extends MarianumConnectQuery {
|
||||
'message': message,
|
||||
'screenshot': ?screenshotBase64,
|
||||
'screenshotContentType': screenshot != null ? screenshotContentType : null,
|
||||
'platform': _platform(),
|
||||
'platform': clientPlatform(),
|
||||
'appVersion': package.version,
|
||||
'appBuild': int.tryParse(package.buildNumber),
|
||||
'deviceModel': await _deviceModel(),
|
||||
@@ -35,12 +36,6 @@ class SubmitFeedback extends MarianumConnectQuery {
|
||||
);
|
||||
});
|
||||
|
||||
static String? _platform() {
|
||||
if (Platform.isAndroid) return 'android';
|
||||
if (Platform.isIOS) return 'ios';
|
||||
return null;
|
||||
}
|
||||
|
||||
static Future<String?> _deviceModel() async {
|
||||
try {
|
||||
final info = DeviceInfoPlugin();
|
||||
|
||||
Reference in New Issue
Block a user