updated project linter-rules and enforced them

This commit is contained in:
2024-03-29 18:22:55 +01:00
parent 21e11b6c2a
commit 75846750f7
113 changed files with 553 additions and 554 deletions

View File

@ -10,8 +10,8 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'accountModel.dart';
class AccountData {
static const _usernameField = "username";
static const _passwordField = "password";
static const _usernameField = 'username';
static const _passwordField = 'password';
static final AccountData _instance = AccountData._construct();
final Future<SharedPreferences> _storage = SharedPreferences.getInstance();
@ -29,21 +29,21 @@ class AccountData {
String? _password;
String getUsername() {
if(_username == null) throw Exception("Username not initialized");
if(_username == null) throw Exception('Username not initialized');
return _username!;
}
String getPassword() {
if(_password == null) throw Exception("Password not initialized");
if(_password == null) throw Exception('Password not initialized');
return _password!;
}
String getUserSecret() {
return sha512.convert(utf8.encode("${AccountData().getUsername()}:${AccountData().getPassword()}")).toString();
return sha512.convert(utf8.encode('${AccountData().getUsername()}:${AccountData().getPassword()}')).toString();
}
Future<String> getDeviceId() async {
return sha512.convert(utf8.encode("${getUserSecret()}@${await FirebaseMessaging.instance.getToken()}")).toString();
return sha512.convert(utf8.encode('${getUserSecret()}@${await FirebaseMessaging.instance.getToken()}')).toString();
}
Future<void> setData(String username, String password) async {
@ -84,7 +84,7 @@ class AccountData {
}
String buildHttpAuthString() {
if(!isPopulated()) throw Exception("AccountData (e.g. username or password) is not initialized!");
return "$_username:$_password";
if(!isPopulated()) throw Exception('AccountData (e.g. username or password) is not initialized!');
return '$_username:$_password';
}
}