LyricStyle class

Constructors

LyricStyle({required TextStyle textStyle, required TextStyle activeStyle, required TextStyle translationStyle, required TextAlign lineTextAlign, required double lineGap, required CrossAxisAlignment contentAlignment, required double translationLineGap, EdgeInsets contentPadding = EdgeInsets.zero, required double selectionAnchorPosition, FadeRange? fadeRange, required Duration scrollDuration, required MainAxisAlignment selectionAlignment, Map<double, Duration> scrollDurations = const {}, required Color selectedColor, required Color selectedTranslationColor, required Duration selectionAutoResumeDuration, required Duration activeAutoResumeDuration, SelectionAutoResumeMode selectionAutoResumeMode = SelectionAutoResumeMode.selecting, Color? activeHighlightColor, bool enableSwitchAnimation = true, Duration switchEnterDuration = const Duration(milliseconds: 200), Duration switchExitDuration = const Duration(milliseconds: 200), Curve switchEnterCurve = Curves.easeIn, Curve switchExitCurve = Curves.easeOut, Curve scrollCurve = Curves.easeOutCubic, Color? translationActiveColor, bool disableTouchEvent = false, double? activeAnchorPosition, double activeHighlightExtraFadeWidth = 0, LinearGradient? activeHighlightGradient, MainAxisAlignment? activeAlignment, bool activeLineOnly = false})

Properties

activeAlignment MainAxisAlignment
播放锚点对齐方式 / Active anchor alignment
final
activeAnchorPosition double
播放锚点位置(0-1 为相对位置,>1 为绝对像素值)/ Active anchor position (0-1 for relative, >1 for absolute pixels)
final
activeAutoResumeDuration Duration
播放行自动恢复时长 / Active line auto resume duration
final
activeHighlightColor Color?
播放行高亮颜色 / Active line highlight color
final
activeHighlightExtraFadeWidth double
高亮渐变末尾附加的渐隐宽度 / Extra fade width at the end of highlight gradient
final
activeHighlightGradient LinearGradient?
播放行高亮渐变 / Active line highlight gradient
final
activeLineOnly bool
是否只绘制播放行 / Whether to only draw the active line
final
activeStyle TextStyle
高亮行文本样式(播放行)/ Highlighted line text style (active/playing line)
final
contentAlignment CrossAxisAlignment
交叉轴对齐方式 / Cross-axis alignment
final
contentPadding EdgeInsets
内容内边距 / Content padding
final
disableTouchEvent bool
是否禁用触摸事件 / Whether to disable touch events
final
enableSwitchAnimation bool
是否启用切换动画 / Enable switch animation
final
fadeRange FadeRange?
上下渐隐范围(上、下)/ Fade range (top, bottom)
final
hashCode int
The hash code for this object.
no setterinherited
isFadeRelative bool
渐隐范围是否为相对值(<=1 为相对值,>1 为绝对值)/ Whether fade range is relative (<=1 for relative, >1 for absolute)
no setter
lineGap double
行间距 / Line gap between lyric lines
final
lineTextAlign TextAlign
文本对齐方式(left / center / right)/ Text alignment (left / center / right)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollCurve Curve
滚动动画曲线 / Scroll animation curve
final
scrollDuration Duration
滚动动画时长 / Scroll animation duration
final
scrollDurations Map<double, Duration>
滚动动画时长映射(更精细的动画时长控制)/ Scroll animation duration map (for finer control)
final
selectedColor Color
选中行字体颜色 / Selected line font color
final
selectedTranslationColor Color
选中翻译行字体颜色 / Selected translation line font color
final
selectionAlignment MainAxisAlignment
选中锚点对齐方式 / Selection anchor alignment
final
selectionAnchorPosition double
选中锚点位置(0-1 为相对位置,>1 为绝对像素值)/ Selection anchor position (0-1 for relative, >1 for absolute pixels)
final
selectionAutoResumeDuration Duration
选中行自动恢复时长 / Selection auto resume duration
final
selectionAutoResumeMode SelectionAutoResumeMode
选中行自动恢复模式 / Selection auto resume mode
final
switchEnterCurve Curve
切换进入动画曲线 / Switch enter animation curve
final
switchEnterDuration Duration
切换进入动画时长 / Switch enter animation duration
final
switchExitCurve Curve
切换退出动画曲线 / Switch exit animation curve
final
switchExitDuration Duration
切换退出动画时长 / Switch exit animation duration
final
textStyle TextStyle
普通行文本样式 / Normal line text style
final
translationActiveColor Color?
翻译行高亮颜色 / Translation line highlight color
final
translationLineGap double
翻译行间距 / Translation line gap
final
translationStyle TextStyle
翻译行文本样式 / Translation line text style
final

Methods

calcActiveAnchorPosition(double viewHeight) double
计算播放锚点位置 / Calculate active anchor position
calcSelectionAnchorPosition(double viewHeight) double
计算选中锚点位置 / Calculate selection anchor position
compareTo(LyricStyle other) RenderComparison
copyWith({TextStyle? textStyle, TextStyle? activeStyle, TextStyle? translationStyle, TextAlign? textAlign, double? lineGap, CrossAxisAlignment? contentAlignment, double? translationLineGap, EdgeInsets? contentPadding, double? anchorPosition, FadeRange? fadeRange, Duration? scrollDuration, MainAxisAlignment? highlightAlign, Map<double, Duration>? scrollDurationMap, Duration? selectLineResumeDuration, Duration? activeLineResumeDuration, SelectionAutoResumeMode? selectLineResumeMode, Object? activeHighlightColor = _unset, bool? enableSwitchAnimation, Duration? switchEnterDuration, Duration? switchExitDuration, Curve? switchEnterCurve, Curve? switchExitCurve, Curve? scrollCurve, Object? translationActiveColor = _unset, Object? activeAnchorPosition = _unset, Color? selectedColor, Color? selectedTranslationColor, Object? activeAlignment = _unset, double? activeHighlightTailGradientWidth, Object? activeHighlightGradient = _unset, bool? activeLineOnly, bool? disableTouchEvent}) LyricStyle
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited