mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-01 23:59:50 +08:00
@@ -77,7 +77,7 @@ abstract class Accounts {
|
||||
}
|
||||
}
|
||||
await Future.wait(
|
||||
(accountMode.toSet()..removeWhere((i) => i.activited)).map(
|
||||
(accountMode.toSet()..removeWhere((i) => i.activated)).map(
|
||||
Request.buvidActive,
|
||||
),
|
||||
);
|
||||
@@ -93,14 +93,14 @@ abstract class Accounts {
|
||||
}
|
||||
|
||||
static Future<void> deleteAll(Set<Account> accounts) async {
|
||||
var isloginMain = Accounts.main.isLogin;
|
||||
var isLoginMain = Accounts.main.isLogin;
|
||||
for (int i = 0; i < AccountType.values.length; i++) {
|
||||
if (accounts.contains(accountMode[i])) {
|
||||
accountMode[i] = AnonymousAccount();
|
||||
}
|
||||
}
|
||||
await Future.wait(accounts.map((i) => i.delete()));
|
||||
if (isloginMain && !Accounts.main.isLogin) {
|
||||
if (isLoginMain && !Accounts.main.isLogin) {
|
||||
await LoginUtils.onLogoutMain();
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ abstract class Accounts {
|
||||
await (accountMode[key.index]..type.remove(key)).onChange();
|
||||
accountMode[key.index] = account..type.add(key);
|
||||
await account.onChange();
|
||||
if (!account.activited) await Request.buvidActive(account);
|
||||
if (!account.activated) await Request.buvidActive(account);
|
||||
switch (key) {
|
||||
case AccountType.main:
|
||||
await (account.isLogin
|
||||
|
||||
@@ -12,9 +12,9 @@ sealed class Account {
|
||||
|
||||
Set<AccountType> get type => const {};
|
||||
|
||||
bool get activited => false;
|
||||
bool get activated => false;
|
||||
|
||||
set activited(bool value) => throw UnimplementedError();
|
||||
set activated(bool value) => throw UnimplementedError();
|
||||
|
||||
String? get accessKey => throw UnimplementedError();
|
||||
|
||||
@@ -53,7 +53,7 @@ class LoginAccount extends Account {
|
||||
final Set<AccountType> type;
|
||||
|
||||
@override
|
||||
bool activited = false;
|
||||
bool activated = false;
|
||||
|
||||
@override
|
||||
late final int mid = int.parse(_midStr);
|
||||
@@ -141,7 +141,7 @@ class AnonymousAccount extends Account {
|
||||
final Map<String, String> headers = Constants.baseHeaders;
|
||||
|
||||
@override
|
||||
bool activited = false;
|
||||
bool activated = false;
|
||||
|
||||
@override
|
||||
Future<void> delete() async {
|
||||
|
||||
@@ -11,7 +11,7 @@ extension ContextExtensions on BuildContext {
|
||||
double get height => MediaQuery.heightOf(this);
|
||||
|
||||
/// The same of [MediaQuery.of(context).size.width]
|
||||
/// Note: updates when you rezise your screen (like on a browser or
|
||||
/// Note: updates when you resize your screen (like on a browser or
|
||||
/// desktop window)
|
||||
double get width => MediaQuery.widthOf(this);
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ abstract class SettingBoxKey {
|
||||
showRelatedVideo = 'showRelatedVideo',
|
||||
showVideoReply = 'showVideoReply',
|
||||
showBangumiReply = 'showBangumiReply',
|
||||
alwaysExapndIntroPanel = 'alwaysExapndIntroPanel',
|
||||
exapndIntroPanelH = 'exapndIntroPanelH',
|
||||
alwaysExpandIntroPanel = 'alwaysExapndIntroPanel',
|
||||
expandIntroPanelH = 'exapndIntroPanelH',
|
||||
horizontalSeasonPanel = 'horizontalSeasonPanel',
|
||||
horizontalMemberPage = 'horizontalMemberPage',
|
||||
replyLengthLimit = 'replyLengthLimit',
|
||||
@@ -159,7 +159,7 @@ abstract class SettingBoxKey {
|
||||
enableDragSubtitle = 'enableDragSubtitle',
|
||||
subtitlePaddingH = 'subtitlePaddingH',
|
||||
subtitlePaddingB = 'subtitlePaddingB',
|
||||
subtitleBgOpaticy = 'subtitleBgOpaticy',
|
||||
subtitleBgOpacity = 'subtitleBgOpaticy',
|
||||
subtitleStrokeWidth = 'subtitleStrokeWidth',
|
||||
subtitleFontScale = 'subtitleFontScale',
|
||||
subtitleFontScaleFS = 'subtitleFontScaleFS',
|
||||
|
||||
@@ -333,11 +333,11 @@ abstract class Pref {
|
||||
static bool get showBangumiReply =>
|
||||
_setting.get(SettingBoxKey.showBangumiReply, defaultValue: true);
|
||||
|
||||
static bool get alwaysExapndIntroPanel =>
|
||||
_setting.get(SettingBoxKey.alwaysExapndIntroPanel, defaultValue: false);
|
||||
static bool get alwaysExpandIntroPanel =>
|
||||
_setting.get(SettingBoxKey.alwaysExpandIntroPanel, defaultValue: false);
|
||||
|
||||
static bool get exapndIntroPanelH =>
|
||||
_setting.get(SettingBoxKey.exapndIntroPanelH, defaultValue: false);
|
||||
static bool get expandIntroPanelH =>
|
||||
_setting.get(SettingBoxKey.expandIntroPanelH, defaultValue: false);
|
||||
|
||||
static bool get horizontalSeasonPanel =>
|
||||
_setting.get(SettingBoxKey.horizontalSeasonPanel, defaultValue: false);
|
||||
@@ -371,8 +371,8 @@ abstract class Pref {
|
||||
static int get subtitlePaddingB =>
|
||||
_setting.get(SettingBoxKey.subtitlePaddingB, defaultValue: 24);
|
||||
|
||||
static double get subtitleBgOpaticy =>
|
||||
_setting.get(SettingBoxKey.subtitleBgOpaticy, defaultValue: 0.67);
|
||||
static double get subtitleBgOpacity =>
|
||||
_setting.get(SettingBoxKey.subtitleBgOpacity, defaultValue: 0.67);
|
||||
|
||||
static double get subtitleStrokeWidth =>
|
||||
_setting.get(SettingBoxKey.subtitleStrokeWidth, defaultValue: 2.0);
|
||||
|
||||
Reference in New Issue
Block a user