Implementation
final Map<ScreenStatus, List<RotationRule>> rotationRulesMap = {
ScreenStatus.normalScreen: [
/// 断点区间:smallPortrait,mediumLandscape (如:直板机,purax折叠设备形态)
/// 屏幕状态:非全屏
/// 视频方向:竖向视频
/// 旋转规则:竖屏显示
RotationRule(
breakPointRanges: [
BreakPointRange.smallPortrait,
BreakPointRange.mediumLandscape,
BreakPointRange.smallSquare,
],
videoDirection: VideoDirection.portrait,
screenStatus: ScreenStatus.normalScreen,
orientations: {
0: OrientationType.portrait,
1: OrientationType.portrait,
2: OrientationType.portrait,
3: OrientationType.portrait,
}),
/// 断点区间:smallPortrait,mediumLandscape (如:直板机)
/// 屏幕状态:非全屏
/// 视频方向:竖向视频
/// 旋转规则:临时旋转到竖向,然后跟随设备旋转
RotationRule(
breakPointRanges: [
BreakPointRange.smallPortrait,
BreakPointRange.mediumLandscape,
],
videoDirection: VideoDirection.landscape,
screenStatus: ScreenStatus.normalScreen,
orientations: {
0: OrientationType.userRotationPortrait,
1: OrientationType.userRotationPortrait,
2: OrientationType.userRotationPortrait,
3: OrientationType.userRotationPortrait,
}),
/// 断点区间:smallSquare (如:purax折叠设备形态)
/// 屏幕状态:非全屏
/// 视频方向:横向视频
/// 旋转规则:竖屏显示
RotationRule(
breakPointRanges: [
BreakPointRange.smallSquare,
],
videoDirection: VideoDirection.landscape,
screenStatus: ScreenStatus.normalScreen,
orientations: {
0: OrientationType.portrait,
1: OrientationType.portrait,
2: OrientationType.portrait,
3: OrientationType.portrait,
}),
/// 断点区间:mediumPortrait,mediumSquare,largePortrait,largeSquare,largeLandscape,xLargeLandscape (如:平板等大屏设备)
/// 屏幕状态:非全屏
/// 视频方向:竖向视频
/// 旋转规则:可自由旋转
RotationRule(
breakPointRanges: [
BreakPointRange.mediumPortrait,
BreakPointRange.mediumSquare,
BreakPointRange.largeLandscape,
BreakPointRange.largeSquare,
BreakPointRange.largePortrait,
BreakPointRange.xLargeLandscape,
],
videoDirection: VideoDirection.portrait,
screenStatus: ScreenStatus.normalScreen,
orientations: {
0: OrientationType.autoRotationUnspecified,
1: OrientationType.autoRotationUnspecified,
2: OrientationType.autoRotationUnspecified,
3: OrientationType.autoRotationUnspecified,
}),
/// 断点区间:mediumPortrait,mediumSquare,largePortrait,largeSquare,largeLandscape,xLargeLandscape (如:平板等大屏设备)
/// 屏幕状态:非全屏
/// 视频方向:横向视频
/// 旋转规则:可自由旋转
RotationRule(
breakPointRanges: [
BreakPointRange.mediumPortrait,
BreakPointRange.mediumSquare,
BreakPointRange.largeLandscape,
BreakPointRange.largeSquare,
BreakPointRange.largePortrait,
BreakPointRange.xLargeLandscape,
],
videoDirection: VideoDirection.landscape,
screenStatus: ScreenStatus.normalScreen,
orientations: {
0: OrientationType.autoRotationUnspecified,
1: OrientationType.autoRotationUnspecified,
2: OrientationType.autoRotationUnspecified,
3: OrientationType.autoRotationUnspecified,
}),
],
/// 竖向全屏
ScreenStatus.portraitFullScreen: [
/// 断点区间:smallPortrait,mediumLandscape,smallSquare (如:直板机,purax折叠设备形态)
/// 屏幕状态:竖向
/// 视频方向:竖向视频
/// 旋转规则:竖屏显示
RotationRule(
breakPointRanges: [
BreakPointRange.smallPortrait,
BreakPointRange.mediumLandscape,
BreakPointRange.smallSquare,
],
videoDirection: VideoDirection.portrait,
screenStatus: ScreenStatus.portraitFullScreen,
orientations: {
0: OrientationType.portrait,
1: OrientationType.portrait,
2: OrientationType.portrait,
3: OrientationType.portrait,
}),
/// 断点区间:mediumPortrait,mediumSquare,largePortrait,largeSquare,largeLandscape,xLargeLandscape (如:平板等大屏设备)
/// 屏幕状态:竖向全屏
/// 视频方向:竖向视频
/// 旋转规则:自由旋转
RotationRule(
breakPointRanges: [
BreakPointRange.mediumPortrait,
BreakPointRange.mediumSquare,
BreakPointRange.largePortrait,
BreakPointRange.largeSquare,
BreakPointRange.largeLandscape,
BreakPointRange.xLargeLandscape,
],
videoDirection: VideoDirection.portrait,
screenStatus: ScreenStatus.portraitFullScreen,
orientations: {
0: OrientationType.autoRotationUnspecified,
1: OrientationType.autoRotationUnspecified,
2: OrientationType.autoRotationUnspecified,
3: OrientationType.autoRotationUnspecified,
}),
],
/// 横向全屏
ScreenStatus.landscapeFullScreen: [
/// 断点区间:smallPortrait,mediumLandscape (如:直板机)
/// 屏幕状态:横向全屏
/// 视频方向:横向视频
/// 旋转规则:竖屏时,临时旋转到反向横向,且随设备旋转方向旋转
RotationRule(
breakPointRanges: [
BreakPointRange.smallPortrait,
BreakPointRange.mediumLandscape
],
videoDirection: VideoDirection.landscape,
screenStatus: ScreenStatus.landscapeFullScreen,
orientations: {
0: OrientationType.userRotationLandscapeInverted,
1: OrientationType.userRotationLandscapeInverted,
2: OrientationType.userRotationLandscape,
3: OrientationType.userRotationLandscape,
}),
/// 断点区间:smallSquare (如:purax折叠设备形态)
/// 屏幕状态:横向全屏
/// 视频方向:横向视频
/// 旋转规则:竖屏显示
RotationRule(
breakPointRanges: [
BreakPointRange.smallSquare,
],
videoDirection: VideoDirection.landscape,
screenStatus: ScreenStatus.landscapeFullScreen,
orientations: {
0: OrientationType.portrait,
1: OrientationType.portrait,
2: OrientationType.portrait,
3: OrientationType.portrait,
}),
/// 断点区间:mediumPortrait,mediumSquare,largePortrait,largeSquare,largeLandscape,xLargeLandscape (如:平板等大屏设备)
/// 屏幕状态:横向全屏
/// 视频方向:横向视频
/// 旋转规则:自由旋转
RotationRule(
breakPointRanges: [
BreakPointRange.mediumPortrait,
BreakPointRange.mediumSquare,
BreakPointRange.largePortrait,
BreakPointRange.largeSquare,
BreakPointRange.largeLandscape,
BreakPointRange.xLargeLandscape
],
videoDirection: VideoDirection.landscape,
screenStatus: ScreenStatus.landscapeFullScreen,
orientations: {
0: OrientationType.autoRotationUnspecified,
1: OrientationType.autoRotationUnspecified,
2: OrientationType.autoRotationUnspecified,
3: OrientationType.autoRotationUnspecified,
}),
],
};