in lib/aliplayer_widget.dart [351:443]
List<SettingItem> _buildSettingItems() {
return [
// 构建声音滑块控件
SettingItem(
type: SettingItemType.slider,
text: "声音",
startIcon: Icons.volume_down_rounded,
endIcon: Icons.volume_up_rounded,
initialValue: _playController.volumeNotifier.value,
onChanged: (value) => _playController.setVolume(value),
),
// 构建亮度滑块控件
SettingItem(
type: SettingItemType.slider,
text: "亮度",
startIcon: Icons.brightness_low_rounded,
endIcon: Icons.brightness_high_rounded,
initialValue: _playController.brightnessNotifier.value,
onChanged: (value) => _playController.setBrightness(value),
),
// 构建倍速选择控件
if (!_isSceneLive())
SettingItem(
type: SettingItemType.selector,
text: "倍速",
startIcon: Icons.speed_rounded,
options: SettingConstants.speedOptions,
initialValue: _playController.speedNotifier.value,
onChanged: (value) => _playController.setSpeed(speed: value),
displayFormatter: (option) => "${option}x",
),
// 构建清晰度选择控件
if (!_isSceneLive())
SettingItem(
type: SettingItemType.selector,
text: "清晰度",
startIcon: Icons.hd_rounded,
options: _playController.trackInfoListNotifier.value,
initialValue: _playController.currentTrackInfoNotifier.value,
onChanged: (value) => _playController.selectTrack(value),
displayFormatter: (option) => TrackInfoUtil.getQuality(option),
),
// 构建循环播放开关控件
if (!_isSceneLive())
SettingItem(
type: SettingItemType.switcher,
text: "循环播放",
startIcon: Icons.loop_rounded,
initialValue: _playController.isLoopNotifier.value,
onChanged: (value) => _playController.setLoop(value),
),
// 构建静音播放开关控件
SettingItem(
type: SettingItemType.switcher,
text: "静音播放",
startIcon: _playController.isMuteNotifier.value
? Icons.volume_off_rounded
: Icons.volume_up_rounded,
initialValue: _playController.isMuteNotifier.value,
onChanged: (value) => _playController.setMute(value),
),
// 构建镜像模式选择控件
SettingItem(
type: SettingItemType.selector,
text: "镜像模式",
startIcon: Icons.swap_horiz_rounded,
options: SettingConstants.mirrorModeOptions,
initialValue: _playController.mirrorModeNotifier.value,
onChanged: (value) => _playController.setMirrorMode(value),
displayFormatter: (option) => FormatUtil.formatMirrorMode(option),
),
// 构建旋转模式选择控件
SettingItem(
type: SettingItemType.selector,
text: "旋转模式",
startIcon: Icons.crop_rotate_rounded,
options: SettingConstants.rotateModeOptions,
initialValue: _playController.rotateModeNotifier.value,
onChanged: (value) => _playController.setRotateMode(value),
displayFormatter: (option) => "$option°",
),
// 构建渲染填充选择控件
SettingItem(
type: SettingItemType.selector,
text: "渲染填充",
startIcon: Icons.crop_rounded,
options: SettingConstants.scaleModeOptions,
initialValue: _playController.scaleModeNotifier.value,
onChanged: (value) => _playController.setScaleMode(value),
displayFormatter: (option) => FormatUtil.formatScaleMode(option),
),
];
}