Skip to content
pubscout

subtitle

0.2.0, released 6 months ago by muhmdhsn313.me

A library to parse and work with multiple subtitle and caption file formats like WebVTT and SRT.

$ flutter pub add subtitle
Source repository

What it does

It fetches, parses, and manages subtitle formats including WebVTT, SRT, TTML, and DFXP. It provides controllers for searching subtitles by duration, deduplicating cues, and handling encoding fallbacks.

AI-written summary of version 0.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display or synchronize subtitles in a video player app.
  • You want to parse local, network, asset, or raw string subtitle files.

Skip it when

  • You are building a backend application that does not deal with caption files.

Strengths

  • Supports multiple popular formats (WebVTT, SRT, TTML, DFXP).
  • High-performance line-based parsing and O(log n + k) multi-cue search.
  • Built-in automatic cue deduplication and encoding fallback.

Weaknesses

  • Limited to subtitle parsing and management rather than a full built-in video rendering player widget.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3
var controller = SubtitleController(
  provider: SubtitleProvider.fromString(
    data: vttData,
    type: SubtitleType.vtt,
  ),
);
await controller.initial();
print(controller.subtitles);

Alternatives

Packages that do the same job and could replace subtitle.

Works with

Packages commonly used together with subtitle: ones it builds on, ones built on it, and its own family.