mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
17 lines
328 B
Dart
17 lines
328 B
Dart
|
import 'dart:convert';
|
||
|
|
||
|
/// API response
|
||
|
///
|
||
|
/// @author Pierre HUBERT
|
||
|
|
||
|
class APIResponse {
|
||
|
final int code;
|
||
|
final String content;
|
||
|
|
||
|
const APIResponse(this.code, this.content) : assert(code != null);
|
||
|
|
||
|
List<dynamic> getArray() => jsonDecode(this.content);
|
||
|
|
||
|
Map<String, dynamic> getObject() => jsonDecode(this.content);
|
||
|
}
|