updateTextOverlay method

void updateTextOverlay(
  1. String id, {
  2. String? text,
  3. double? fontSize,
  4. Color? color,
  5. TextOverlayStyle? style,
  6. Color? backgroundColor,
  7. bool? bold,
})

Implementation

void updateTextOverlay(
  String id, {
  String? text,
  double? fontSize,
  Color? color,
  TextOverlayStyle? style,
  Color? backgroundColor,
  bool? bold,
}) {
  final index = _textOverlays.indexWhere((t) => t.id == id);
  if (index != -1) {
    final o = _textOverlays[index];
    if (text != null) o.text = text;
    if (fontSize != null) o.fontSize = fontSize;
    if (color != null) o.color = color;
    if (style != null) o.style = style;
    if (backgroundColor != null) o.backgroundColor = backgroundColor;
    if (bold != null) o.bold = bold;
  }
}