Add self timeline to timeline screen

merge-requests/67/merge
Hank Grabowski 2022-12-17 12:17:47 -05:00
rodzic 3f40db8408
commit 40380e4a15
3 zmienionych plików z 10 dodań i 10 usunięć

Wyświetl plik

@ -472,7 +472,8 @@ class FriendicaClient {
case TimelineType.profile:
return '/accounts/${type.auxData}/statuses';
case TimelineType.self:
throw UnimplementedError('These types are not supported yet');
final myId = getIt<AuthService>().currentId;
return '/accounts/$myId/statuses';
}
}
@ -482,11 +483,10 @@ class FriendicaClient {
case TimelineType.global:
case TimelineType.profile:
case TimelineType.group:
case TimelineType.self:
return '';
case TimelineType.local:
return 'local=true';
case TimelineType.self:
throw UnimplementedError('These types are not supported yet');
}
}

Wyświetl plik

@ -19,7 +19,7 @@ enum TimelineType {
case TimelineType.profile:
return 'Profile';
case TimelineType.self:
return 'Self';
return 'Yours';
}
}
}
@ -37,8 +37,7 @@ class TimelineIdentifiers {
factory TimelineIdentifiers.home() =>
TimelineIdentifiers(timeline: TimelineType.home);
factory TimelineIdentifiers.profile(String profileId) =>
TimelineIdentifiers(
factory TimelineIdentifiers.profile(String profileId) => TimelineIdentifiers(
timeline: TimelineType.profile,
auxData: profileId,
);
@ -53,10 +52,10 @@ class TimelineIdentifiers {
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TimelineIdentifiers &&
runtimeType == other.runtimeType &&
timeline == other.timeline &&
auxData == other.auxData;
other is TimelineIdentifiers &&
runtimeType == other.runtimeType &&
timeline == other.timeline &&
auxData == other.auxData;
@override
int get hashCode => timeline.hashCode ^ auxData.hashCode;

Wyświetl plik

@ -24,6 +24,7 @@ class _HomeScreenState extends State<HomeScreen> {
var currentType = TimelineType.home;
GroupData? currentGroup;
final types = [
TimelineType.self,
TimelineType.home,
TimelineType.global,
TimelineType.local,