feat: 全屏方式设置

This commit is contained in:
guozhigq
2023-08-13 19:40:22 +08:00
parent 17b02d9ae9
commit f50e6d18dd
4 changed files with 87 additions and 11 deletions

View File

@ -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;
}
}