lyricTimeToDuration method

Duration lyricTimeToDuration (
  1. String time
)

Implementation

static Duration lyricTimeToDuration(String time) {
  int hourSeparatorIndex = time.indexOf(":");
  int minuteSeparatorIndex = time.indexOf(".");
  return Duration(
    minutes: int.parse(
      time.substring(0, hourSeparatorIndex),
    ),
    seconds: int.parse(
        time.substring(hourSeparatorIndex + 1, minuteSeparatorIndex)),
    milliseconds: int.parse(time.substring(minuteSeparatorIndex + 1)),
  );
}