operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

判断两个字幕是否相等。

当 index 和 text 均相同时视为相等。

Determines whether two subtitles are equal.

Two subtitles are considered equal when both index and text match.

Implementation

@override
bool operator ==(Object other) {
  if (identical(this, other)) return true;

  return other is Subtitle && other.index == index && other.text == text;
}