mirror of
https://github.com/linagora/tmail-flutter.git
synced 2026-12-05 16:08:46 +00:00
20 lines
501 B
Dart
20 lines
501 B
Dart
/// Backend a test runs against; defaults to the --dart-define URL.
|
|
class TestBackend {
|
|
final String url;
|
|
final String? token;
|
|
|
|
const TestBackend({required this.url, this.token});
|
|
|
|
static const TestBackend fromDefines = TestBackend(
|
|
url: String.fromEnvironment('BASIC_AUTH_URL'),
|
|
);
|
|
|
|
static TestBackend? _leased;
|
|
|
|
static TestBackend get current => _leased ?? fromDefines;
|
|
|
|
static TestBackend? get leased => _leased;
|
|
|
|
static void use(TestBackend? backend) => _leased = backend;
|
|
}
|