mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-18 08:06:21 +08:00
mod: lint
mod: tweaks opt: publish page Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -6,18 +6,13 @@ enum BtmProgressBehavior {
|
||||
}
|
||||
|
||||
extension BtmProgresBehaviorDesc on BtmProgressBehavior {
|
||||
String get description => ['始终展示', '始终隐藏', '仅全屏时展示', '仅全屏时隐藏'][index];
|
||||
String get description => const ['始终展示', '始终隐藏', '仅全屏时展示', '仅全屏时隐藏'][index];
|
||||
}
|
||||
|
||||
extension BtmProgresBehaviorCode on BtmProgressBehavior {
|
||||
static final List<int> _codeList = [0, 1, 2, 3];
|
||||
int get code => _codeList[index];
|
||||
int get code => index;
|
||||
|
||||
static BtmProgressBehavior? fromCode(int code) {
|
||||
final index = _codeList.indexOf(code);
|
||||
if (index != -1) {
|
||||
return BtmProgressBehavior.values[index];
|
||||
}
|
||||
return null;
|
||||
static BtmProgressBehavior fromCode(int code) {
|
||||
return BtmProgressBehavior.values[code];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user