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
+13 -4
View File
@@ -34,11 +34,16 @@ class AccountData {
return _password!;
}
String getUserSecret() =>
sha512.convert(utf8.encode('${getUsername()}:${getPassword()}')).toString();
String getUserSecret() => sha512
.convert(utf8.encode('${getUsername()}:${getPassword()}'))
.toString();
Future<String> getDeviceId() async => sha512
.convert(utf8.encode('${getUserSecret()}@${await FirebaseMessaging.instance.getToken()}'))
.convert(
utf8.encode(
'${getUserSecret()}@${await FirebaseMessaging.instance.getToken()}',
),
)
.toString();
Future<void> setData(String username, String password) async {
@@ -92,7 +97,11 @@ class AccountData {
/// Prefer this over embedding credentials in URLs — error logs and crash
/// reports often capture the URL but not headers.
String getBasicAuthHeader() {
if (!isPopulated()) throw Exception('AccountData (e.g. username or password) is not initialized!');
if (!isPopulated()) {
throw Exception(
'AccountData (e.g. username or password) is not initialized!',
);
}
return 'Basic ${base64Encode(utf8.encode('$_username:$_password'))}';
}