o2_api_response.dart 735 B

1234567891011121314151617181920212223242526272829303132333435
  1. class ApiResponse {
  2. String? type;//success
  3. String? date;
  4. int? spent;
  5. int? size;
  6. int? count;
  7. int? position;
  8. String? message;
  9. dynamic data;
  10. ApiResponse({this.type, this.date, this.spent, this.size, this.count,this.position,this.message,this.data});
  11. ApiResponse.fromJson(Map<String, dynamic>? map) {
  12. if (map != null) {
  13. type = map['type'];
  14. date = map['date'];
  15. spent = map['spent'];
  16. size = map['size'];
  17. count = map['count'];
  18. position = map['position'];
  19. message = map['message'];
  20. type = map['type'];
  21. data = map['data'];
  22. }
  23. }
  24. bool isSuccess() {
  25. if (type != null && type == 'success') {
  26. return true;
  27. }
  28. return false;
  29. }
  30. }