056970d8
Key
feat: api
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import 'package:flutter/foundation.dart';
import '../../../generated/json/base/json_convert_content.dart';
import 'api_response_entity.dart';
ApiResponse<T> $ApiResponseFromJson<T>(Map<String, dynamic> json) {
final ApiResponse<T> apiResponseEntity = ApiResponse<T>();
final int? code = jsonConvert.convert<int>(json['code']);
if (code != null) {
apiResponseEntity.code = code;
}
final String? msg = jsonConvert.convert<String>(json['msg']);
if (msg != null) {
apiResponseEntity.msg = msg;
}
String type = T.toString();
T? data;
if (kDebugMode) {
|
056970d8
Key
feat: api
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
}
if (data != null) {
apiResponseEntity.data = data;
}
return apiResponseEntity;
}
Map<String, dynamic> $ApiResponseToJson(ApiResponse entity) {
final Map<String, dynamic> data = <String, dynamic>{};
data['code'] = entity.code;
data['msg'] = entity.msg;
data['data'] = entity.data;
return data;
}
|