mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 全屏方式设置
This commit is contained in:
@@ -7,3 +7,20 @@ enum FullScreenMode {
|
||||
// 始终横屏
|
||||
horizontal
|
||||
}
|
||||
|
||||
extension FullScreenModeDesc on FullScreenMode {
|
||||
String get description => ['自适应', '始终竖屏', '始终横屏'][index];
|
||||
}
|
||||
|
||||
extension FullScreenModeCode on FullScreenMode {
|
||||
static final List<int> _codeList = [0, 1, 2];
|
||||
int get code => _codeList[index];
|
||||
|
||||
static FullScreenMode? fromCode(int code) {
|
||||
final index = _codeList.indexOf(code);
|
||||
if (index != -1) {
|
||||
return FullScreenMode.values[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user