2021-12-10 11:40:20 +01:00
|
|
|
import 'dart:async';
|
|
|
|
|
2022-12-01 00:50:55 +01:00
|
|
|
import 'package:openmediacentermobile/db/settings_db.dart';
|
2021-12-10 11:40:20 +01:00
|
|
|
|
2021-12-11 17:17:38 +01:00
|
|
|
class TokenT {
|
|
|
|
String token;
|
|
|
|
String domain;
|
|
|
|
|
2022-12-01 00:50:55 +01:00
|
|
|
TokenT(this.token, this.domain);
|
2021-12-11 17:17:38 +01:00
|
|
|
}
|
|
|
|
|
2022-12-01 00:50:55 +01:00
|
|
|
Future<TokenT?> getToken() async {
|
|
|
|
final settings = await SettingsDB.getInstance().getSettings();
|
|
|
|
if (settings.token == "" || settings.domain == "") {
|
|
|
|
return null;
|
|
|
|
} else {
|
|
|
|
return TokenT(settings.token, settings.domain);
|
2021-12-10 11:40:20 +01:00
|
|
|
}
|
|
|
|
}
|