SubtitleStyleConfig constructor

const SubtitleStyleConfig({
  1. TextStyle textStyle = const TextStyle(fontSize: 16, color: Colors.white, backgroundColor: Colors.transparent, fontWeight: FontWeight.normal),
  2. EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 10, vertical: 1),
  3. EdgeInsets margin = const EdgeInsets.all(1.0),
  4. BoxDecoration? decoration = const BoxDecoration(color: Colors.transparent, borderRadius: BorderRadius.all(Radius.circular(6))),
  5. double? maxWidth,
  6. int? maxLines,
  7. TextOverflow overflow = TextOverflow.clip,
})

创建字幕样式配置。

Creates a subtitle style configuration.

  • textStyle 字幕文本样式。 The text style for subtitle text.
  • padding 字幕容器内边距。 The padding inside the subtitle container.
  • margin 字幕容器外边距。 The margin outside the subtitle container.
  • decoration 字幕容器装饰。 The decoration for the subtitle container.
  • maxWidth 字幕容器最大宽度。 The maximum width of the subtitle container.
  • maxLines 字幕文本最大行数。 The maximum number of lines for subtitle text.
  • overflow 字幕文本溢出策略。 The overflow strategy for subtitle text.

Implementation

const SubtitleStyleConfig({
  this.textStyle = const TextStyle(
    fontSize: 16,
    color: Colors.white,
    backgroundColor: Colors.transparent,
    fontWeight: FontWeight.normal,
  ),
  this.padding = const EdgeInsets.symmetric(horizontal: 10, vertical: 1),
  this.margin = const EdgeInsets.all(1.0),
  this.decoration = const BoxDecoration(
    color: Colors.transparent,
    borderRadius: BorderRadius.all(Radius.circular(6)),
  ),
  this.maxWidth,
  this.maxLines,
  this.overflow = TextOverflow.clip,
});