migrated timetable integration from WebUntis to the MarianumConnect API, implementing a Dio-based client with bearer token authentication, background session validation, and auto-refresh logic.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import '../../storage/dev_tools_settings.dart';
|
||||
|
||||
/// Singleton holding the currently active Marianum-Connect base URL. Fed by a
|
||||
/// SettingsCubit listener in app.dart so every dio call picks up endpoint
|
||||
/// changes without holding a reference to the cubit.
|
||||
class MarianumConnectEndpoint {
|
||||
static String _baseUrl = DevToolsSettings.liveUrl;
|
||||
|
||||
static String current() => _baseUrl;
|
||||
|
||||
static void update(String baseUrl) {
|
||||
_baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
/// Joins the base URL with the mobile API prefix and the given path.
|
||||
static String resolve(String relativePath) {
|
||||
final path = relativePath.startsWith('/')
|
||||
? relativePath.substring(1)
|
||||
: relativePath;
|
||||
return '$_baseUrl/api/mobile/v1/$path';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user