mirror of
https://gitlab.com/mysocialportal/relatica
synced 2024-10-18 21:43:31 +00:00
39 lines
879 B
Dart
39 lines
879 B
Dart
enum TimelineType {
|
|
home,
|
|
global,
|
|
local,
|
|
tag,
|
|
profile,
|
|
self,
|
|
}
|
|
|
|
class TimelineIdentifiers {
|
|
final TimelineType timeline;
|
|
final String auxData;
|
|
|
|
TimelineIdentifiers({required this.timeline, this.auxData = ''});
|
|
|
|
String toHumanKey() {
|
|
return auxData.isEmpty ? timeline.name : '${timeline.name}_$auxData';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is TimelineIdentifiers &&
|
|
runtimeType == other.runtimeType &&
|
|
timeline == other.timeline;
|
|
|
|
@override
|
|
int get hashCode => timeline.hashCode;
|
|
|
|
factory TimelineIdentifiers.home() =>
|
|
TimelineIdentifiers(timeline: TimelineType.home);
|
|
|
|
@override
|
|
String toString() {
|
|
return auxData.isEmpty
|
|
? 'TimelineIdentifiers{timeline: $timeline)'
|
|
: 'TimelineIdentifiers{timeline: $timeline, auxData: $auxData}';
|
|
}
|
|
}
|