dart format

This commit is contained in:
2026-05-08 20:12:40 +02:00
parent 9e139b5704
commit 3b8da1d3d6
295 changed files with 6404 additions and 4161 deletions
@@ -6,7 +6,6 @@ import 'package:http/http.dart' as http;
import '../../mhsl_api.dart';
import 'add_feedback_params.dart';
class AddFeedback extends MhslApi<void> {
AddFeedbackParams params;
AddFeedback(this.params) : super('server/feedback');
@@ -15,5 +14,6 @@ class AddFeedback extends MhslApi<void> {
void assemble(String raw) {}
@override
Future<Response>? request(Uri uri) => http.post(uri, body: jsonEncode(params.toJson()));
Future<Response>? request(Uri uri) =>
http.post(uri, body: jsonEncode(params.toJson()));
}
@@ -9,7 +9,6 @@ class AddFeedbackParams {
String? screenshot;
int appVersion;
AddFeedbackParams({
required this.user,
required this.feedback,
@@ -17,6 +16,7 @@ class AddFeedbackParams {
required this.appVersion,
});
factory AddFeedbackParams.fromJson(Map<String, dynamic> json) => _$AddFeedbackParamsFromJson(json);
factory AddFeedbackParams.fromJson(Map<String, dynamic> json) =>
_$AddFeedbackParamsFromJson(json);
Map<String, dynamic> toJson() => _$AddFeedbackParamsToJson(this);
}
@@ -10,15 +10,15 @@ class UpdateUserIndexParams {
int appVersion;
String deviceInfo;
UpdateUserIndexParams({
required this.user,
required this.username,
required this.device,
required this.appVersion,
required this.deviceInfo
required this.deviceInfo,
});
factory UpdateUserIndexParams.fromJson(Map<String, dynamic> json) => _$UpdateUserIndexParamsFromJson(json);
factory UpdateUserIndexParams.fromJson(Map<String, dynamic> json) =>
_$UpdateUserIndexParamsFromJson(json);
Map<String, dynamic> toJson() => _$UpdateUserIndexParamsToJson(this);
}
@@ -1,4 +1,3 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
@@ -26,14 +25,18 @@ class UpdateUserIndex extends MhslApi<void> {
}
static Future<void> index() async {
unawaited(UpdateUserIndex(
UpdateUserIndexParams(
username: AccountData().getUsername(),
user: AccountData().getUserSecret(),
device: await AccountData().getDeviceId(),
appVersion: int.parse((await PackageInfo.fromPlatform()).buildNumber),
deviceInfo: jsonEncode((await DeviceInfoPlugin().deviceInfo).data).toString(),
),
).run());
unawaited(
UpdateUserIndex(
UpdateUserIndexParams(
username: AccountData().getUsername(),
user: AccountData().getUserSecret(),
device: await AccountData().getDeviceId(),
appVersion: int.parse((await PackageInfo.fromPlatform()).buildNumber),
deviceInfo: jsonEncode(
(await DeviceInfoPlugin().deviceInfo).data,
).toString(),
),
).run(),
);
}
}