SubtitleStyleConfig class
字幕样式配置,控制字幕的文本样式和布局属性。
包含文本样式、内边距、外边距、装饰、最大宽度、最大行数和溢出策略等属性, 供 SubtitleConfig 引用以完成字幕渲染。
Subtitle style configuration that controls text style and layout properties.
Contains text style, padding, margin, decoration, max width, max lines, and overflow policy, referenced by SubtitleConfig for subtitle rendering.
Constructors
- SubtitleStyleConfig({TextStyle textStyle = const TextStyle(fontSize: 16, color: Colors.white, backgroundColor: Colors.transparent, fontWeight: FontWeight.normal), EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 10, vertical: 1), EdgeInsets margin = const EdgeInsets.all(1.0), BoxDecoration? decoration = const BoxDecoration(color: Colors.transparent, borderRadius: BorderRadius.all(Radius.circular(6))), double? maxWidth, int? maxLines, TextOverflow overflow = TextOverflow.clip})
-
创建字幕样式配置。
const
Properties
- decoration → BoxDecoration?
-
字幕容器装饰,如背景色和圆角。
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- margin → EdgeInsets
-
字幕容器外边距。
final
- maxLines → int?
-
字幕文本最大行数。
final
- maxWidth → double?
-
字幕容器最大宽度。
final
- overflow → TextOverflow
-
字幕文本溢出策略。
final
- padding → EdgeInsets
-
字幕容器内边距。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textStyle → TextStyle
-
字幕文本样式。
final
Methods
-
copyWith(
{TextStyle? textStyle, EdgeInsets? padding, EdgeInsets? margin, BoxDecoration? decoration, double? maxWidth, int? maxLines, TextOverflow? overflow}) → SubtitleStyleConfig - 创建当前样式配置的副本,可选覆盖部分属性。
-
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