Blame view

lib/common/request/api_response/api_response_entity.dart 367 Bytes
056970d8   Key   feat: api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  import 'dart:convert';
  
  import 'api_response_entity.g.dart';
  
  class ApiResponse<T> {
    int? code;
    String? msg;
    T? data;
  
    ApiResponse();
  
    factory ApiResponse.fromJson(Map<String, dynamic> json) => $ApiResponseFromJson<T>(json);
  
    Map<String, dynamic> toJson() => $ApiResponseToJson(this);
  
    @override
    String toString() {
      return jsonEncode(this);
    }
  }