instanceTimeline function

Future<Map<String, dynamic>> instanceTimeline(
  1. String baseUrl,
  2. String apiBase,
  3. bool withFiles,
  4. bool withRenotes,
  5. bool withReplies,
  6. int noteCount,
)

Attempts to retrieve a map of all notes on the supplied instance. If this fails, an error map is returned.

Implementation

Future<Map<String,dynamic>> instanceTimeline(
  String baseUrl,
  String apiBase,
  bool withFiles,
  bool withRenotes,
  bool withReplies,
  int noteCount
) async {
  Map<String,dynamic> headers = new Map();
  headers['Content-Type'] = 'application/json';
  Map<String,dynamic> payload = new Map();
  payload['withFiles'] = withFiles;
  payload['withRenotes'] = withRenotes;
  payload['withReplies'] = withReplies;
  payload['limit'] = noteCount;
  String reqUrl = '$baseUrl$apiBase/notes/local-timeline';
  Map<String,dynamic> userInfo = await fetchJSON(
    'POST',
    headers,
    payload,
    reqUrl
  );
  return userInfo;
}