getAllMedia method
Retrieve all the media of the project.
Implementation
Future<List<MBMedia>> getAllMedia() async {
Map<String, String> apiParameters = {};
String apiName = 'api/media';
apiParameters.addAll(await defaultParameters());
var uri = Uri.https(endpoint, apiName, apiParameters);
var response = await http.get(uri, headers: await headers());
List<dynamic>? body =
MBManager.checkResponseForType<List<dynamic>>(response.body);
List<Map<String, dynamic>> bodyArray =
List.castFrom<dynamic, Map<String, dynamic>>(body);
return bodyArray.map((d) => MBMedia(dictionary: d)).toList();
}