publicTimeline method

Future<List<Status>> publicTimeline({
  1. bool local = false,
  2. bool remote = false,
  3. bool onlyMedia = false,
  4. String? maxId,
  5. String? sinceId,
  6. String? minId,
  7. int limit = 20,
})
inherited

GET /api/v1/timelines/public

  • public
  • read read:statuses

Implementation

Future<List<Status>> publicTimeline({
  bool local = false,
  bool remote = false,
  bool onlyMedia = false,
  String? maxId,
  String? sinceId,
  String? minId,
  int limit = 20,
}) async {
  final response = await request(
    Method.get,
    "/api/v1/timelines/public",
    authenticated: true,
    payload: {
      "local": "$local",
      "remote": "$remote",
      "only_media": "$onlyMedia",
      "max_id": maxId,
      "since_id": sinceId,
      "min_id": minId,
      "limit": "$limit",
    },
  );

  return List<Status>.from(
    json.decode(response.body).map((json) => Status.fromJson(json)),
  );
}