better loading indicators for timetables, talk and files

This commit is contained in:
2026-05-05 21:07:48 +02:00
parent bee5c02a4f
commit db9c3386f1
25 changed files with 439 additions and 203 deletions
+9 -2
View File
@@ -98,8 +98,15 @@ class AccountData {
bool isPopulated() => _username != null && _password != null;
String buildHttpAuthString() {
/// Returns the value for an HTTP `Authorization` header using HTTP Basic.
/// 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!');
return '$_username:$_password';
return 'Basic ${base64Encode(utf8.encode('$_username:$_password'))}';
}
/// Convenience wrapper around [getBasicAuthHeader] returning a single-entry
/// header map ready to merge into HTTP request headers.
Map<String, String> authHeaders() => {'Authorization': getBasicAuthHeader()};
}