dart format
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
|
||||
import 'account_data.dart';
|
||||
|
||||
enum EndpointMode {
|
||||
live,
|
||||
stage,
|
||||
}
|
||||
enum EndpointMode { live, stage }
|
||||
|
||||
class EndpointOptions {
|
||||
Endpoint live;
|
||||
@@ -12,7 +8,7 @@ class EndpointOptions {
|
||||
EndpointOptions({required this.live, required this.staged});
|
||||
|
||||
Endpoint get(EndpointMode mode) {
|
||||
if(staged == null || mode == EndpointMode.live) return live;
|
||||
if (staged == null || mode == EndpointMode.live) return live;
|
||||
return staged!;
|
||||
}
|
||||
}
|
||||
@@ -36,27 +32,21 @@ class EndpointData {
|
||||
EndpointMode getEndpointMode() {
|
||||
late String existingName;
|
||||
existingName = AccountData().getUsername();
|
||||
return existingName.startsWith('google') ? EndpointMode.stage : EndpointMode.live;
|
||||
return existingName.startsWith('google')
|
||||
? EndpointMode.stage
|
||||
: EndpointMode.live;
|
||||
}
|
||||
|
||||
Endpoint webuntis() => EndpointOptions(
|
||||
live: Endpoint(
|
||||
domain: 'marianum-fulda.webuntis.com',
|
||||
),
|
||||
staged: Endpoint(
|
||||
domain: 'mhsl.eu',
|
||||
path: '/marianum/marianummobile/webuntis/public/index.php/api'
|
||||
),
|
||||
).get(getEndpointMode());
|
||||
live: Endpoint(domain: 'marianum-fulda.webuntis.com'),
|
||||
staged: Endpoint(
|
||||
domain: 'mhsl.eu',
|
||||
path: '/marianum/marianummobile/webuntis/public/index.php/api',
|
||||
),
|
||||
).get(getEndpointMode());
|
||||
|
||||
Endpoint nextcloud() => EndpointOptions(
|
||||
live: Endpoint(
|
||||
domain: 'cloud.marianum-fulda.de',
|
||||
),
|
||||
staged: Endpoint(
|
||||
domain: 'mhsl.eu',
|
||||
path: '/marianum/marianummobile/cloud',
|
||||
)
|
||||
).get(getEndpointMode());
|
||||
|
||||
live: Endpoint(domain: 'cloud.marianum-fulda.de'),
|
||||
staged: Endpoint(domain: 'mhsl.eu', path: '/marianum/marianummobile/cloud'),
|
||||
).get(getEndpointMode());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user