new settings panel for url pickup
All checks were successful
Release / meta (push) Successful in 12s
Release / linux-build (push) Successful in 7m42s
Release / android-build (push) Successful in 16m34s
Release / release-dev (push) Successful in 38s
Release / release-master (push) Successful in 37s

This commit is contained in:
2025-12-22 22:45:33 +00:00
parent dc5ed2567f
commit 950978b021
14 changed files with 322 additions and 43 deletions

View File

@@ -5,17 +5,24 @@ typedef TokenProvider = String? Function();
typedef UnauthorizedHandler = Future<void> Function();
class ApiService {
final String baseUrl;
String _baseUrl;
final http.Client _client;
final Duration timeout;
TokenProvider? _getToken;
UnauthorizedHandler? _onUnauthorized;
ApiService({
required this.baseUrl,
required String baseUrl,
http.Client? client,
this.timeout = const Duration(seconds: 30),
}) : _client = client ?? http.Client();
}) : _baseUrl = baseUrl,
_client = client ?? http.Client();
String get baseUrl => _baseUrl;
void setBaseUrl(String url) {
_baseUrl = url;
}
void setTokenProvider(TokenProvider provider) {
_getToken = provider;