You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			256 lines
		
	
	
		
			7.2 KiB
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			256 lines
		
	
	
		
			7.2 KiB
		
	
	
	
		
			Dart
		
	
import 'dart:convert';
 | 
						|
 | 
						|
import 'package:flutter/foundation.dart';
 | 
						|
 | 
						|
class AllRequestsAndCount {
 | 
						|
  CountServiceRequest? countServiceRequest;
 | 
						|
  CountServiceRequest? countGasRefill;
 | 
						|
  CountServiceRequest? countAssetTransfer;
 | 
						|
  CountServiceRequest? countPPM;
 | 
						|
  DetailsStatusTotal? detailsStatusTotal;
 | 
						|
  CountServiceRequest? total;
 | 
						|
  List<RequestsDetails>? requestsDetails;
 | 
						|
 | 
						|
  AllRequestsAndCount({
 | 
						|
    this.countServiceRequest,
 | 
						|
    this.countGasRefill,
 | 
						|
    this.countAssetTransfer,
 | 
						|
    this.countPPM,
 | 
						|
    this.detailsStatusTotal,
 | 
						|
    this.total,
 | 
						|
    this.requestsDetails,
 | 
						|
  });
 | 
						|
 | 
						|
  AllRequestsAndCount.fromJsonCons(Map<String, dynamic> json) {
 | 
						|
    countServiceRequest = json['countServiceRequest'] != null ? CountServiceRequest.fromJson(json['countServiceRequest']) : null;
 | 
						|
    countGasRefill = json['countGasRefill'] != null ? CountServiceRequest.fromJson(json['countGasRefill']) : null;
 | 
						|
    countAssetTransfer = json['countAssetTransfer'] != null ? CountServiceRequest.fromJson(json['countAssetTransfer']) : null;
 | 
						|
    countPPM = json['countPPM'] != null ? CountServiceRequest.fromJson(json['countPPM']) : null;
 | 
						|
    detailsStatusTotal = json['detailsStatusTotal'] != null ? DetailsStatusTotal.fromJson(json['detailsStatusTotal']) : null;
 | 
						|
    total = json['total'] != null ? CountServiceRequest.fromJson(json['total']) : null;
 | 
						|
    if (json['requestsDetails'] != null) {
 | 
						|
      requestsDetails = <RequestsDetails>[];
 | 
						|
      json['requestsDetails'].forEach((v) {
 | 
						|
        requestsDetails!.add(RequestsDetails.fromJson(v));
 | 
						|
      });
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
  static Future<AllRequestsAndCount> fromJson(Map<String, dynamic> json) {
 | 
						|
    return compute(AllRequestsAndCount.fromJsonCons, json);
 | 
						|
  }
 | 
						|
 | 
						|
  Map<String, dynamic> toJson() {
 | 
						|
    final Map<String, dynamic> data = <String, dynamic>{};
 | 
						|
    if (countServiceRequest != null) {
 | 
						|
      data['countServiceRequest'] = countServiceRequest!.toJson();
 | 
						|
    }
 | 
						|
    if (countGasRefill != null) {
 | 
						|
      data['countGasRefill'] = countGasRefill!.toJson();
 | 
						|
    }
 | 
						|
    if (countAssetTransfer != null) {
 | 
						|
      data['countAssetTransfer'] = countAssetTransfer!.toJson();
 | 
						|
    }
 | 
						|
    if (countPPM != null) {
 | 
						|
      data['countPPM'] = countPPM!.toJson();
 | 
						|
    }
 | 
						|
    if (detailsStatusTotal != null) {
 | 
						|
      data['detailsStatusTotal'] = detailsStatusTotal!.toJson();
 | 
						|
    }
 | 
						|
    if (total != null) {
 | 
						|
      data['total'] = total!.toJson();
 | 
						|
    }
 | 
						|
    if (requestsDetails != null) {
 | 
						|
      data['requestsDetails'] = requestsDetails!.map((v) => v.toJson()).toList();
 | 
						|
    }
 | 
						|
    return data;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
class CountServiceRequest {
 | 
						|
  int? count;
 | 
						|
 | 
						|
  CountServiceRequest({this.count});
 | 
						|
 | 
						|
  CountServiceRequest.fromJson(Map<String, dynamic> json) {
 | 
						|
    count = json['count'];
 | 
						|
  }
 | 
						|
 | 
						|
  Map<String, dynamic> toJson() {
 | 
						|
    final Map<String, dynamic> data = <String, dynamic>{};
 | 
						|
    data['count'] = count;
 | 
						|
    return data;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
class DetailsStatusTotal {
 | 
						|
  int? open;
 | 
						|
  int? inProgress;
 | 
						|
  int? closed;
 | 
						|
 | 
						|
  DetailsStatusTotal({this.open, this.inProgress, this.closed});
 | 
						|
 | 
						|
  DetailsStatusTotal.fromJson(Map<String, dynamic> json) {
 | 
						|
    open = json['open'];
 | 
						|
    inProgress = json['inProgress'];
 | 
						|
    closed = json['closed'];
 | 
						|
  }
 | 
						|
 | 
						|
  Map<String, dynamic> toJson() {
 | 
						|
    final Map<String, dynamic> data = <String, dynamic>{};
 | 
						|
    data['open'] = open;
 | 
						|
    data['inProgress'] = inProgress;
 | 
						|
    data['closed'] = closed;
 | 
						|
    return data;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
class RequestsDetails {
 | 
						|
  int? id;
 | 
						|
  String? nameOfType;
 | 
						|
  String? priority;
 | 
						|
  String? status;
 | 
						|
  String? assetName;
 | 
						|
  String? assetNo;
 | 
						|
  String? assetSN;
 | 
						|
  String? model;
 | 
						|
  String? supplier;
 | 
						|
  String? manufacturer;
 | 
						|
  String? requestType;
 | 
						|
  String? requestNo;
 | 
						|
  String? gasType;
 | 
						|
  String? site;
 | 
						|
  String? statusReceiver;
 | 
						|
  String? assetTransferFrom;
 | 
						|
  String? assetTransferTo;
 | 
						|
  String? code;
 | 
						|
  String? date;
 | 
						|
  String? siteTransferFrom;
 | 
						|
  String? siteTransferTo;
 | 
						|
  int? transactionType;
 | 
						|
 | 
						|
  RequestsDetails(
 | 
						|
      {this.id,
 | 
						|
      this.nameOfType,
 | 
						|
      this.priority,
 | 
						|
      this.status,
 | 
						|
      this.assetName,
 | 
						|
      this.assetNo,
 | 
						|
      this.assetSN,
 | 
						|
      this.model,
 | 
						|
      this.supplier,
 | 
						|
      this.manufacturer,
 | 
						|
      this.requestType,
 | 
						|
      this.requestNo,
 | 
						|
      this.gasType,
 | 
						|
      this.site,
 | 
						|
      this.statusReceiver,
 | 
						|
      this.assetTransferFrom,
 | 
						|
      this.assetTransferTo,
 | 
						|
      this.code,
 | 
						|
      this.siteTransferFrom,
 | 
						|
      this.siteTransferTo,
 | 
						|
      this.date,
 | 
						|
      this.transactionType});
 | 
						|
 | 
						|
  RequestsDetails.fromJson(Map<String, dynamic> json) {
 | 
						|
    id = json['id'];
 | 
						|
    nameOfType = json['nameOfType'];
 | 
						|
    priority = json['priority'];
 | 
						|
    status = json['status'];
 | 
						|
    assetName = json['assetName'];
 | 
						|
    assetNo = json['assetNo'];
 | 
						|
    assetSN = json['assetSN'];
 | 
						|
    model = json['model'];
 | 
						|
    supplier = json['supplier'];
 | 
						|
    manufacturer = json['manufacturer'];
 | 
						|
    requestType = json['requestType'];
 | 
						|
    requestNo = json['requestNo'];
 | 
						|
    gasType = json['gasType'];
 | 
						|
    site = json['site'];
 | 
						|
    statusReceiver = json['statusReceiver'];
 | 
						|
    assetTransferFrom = json['assetTransferFrom'];
 | 
						|
    assetTransferTo = json['assetTransferTo'];
 | 
						|
    code = json['code'];
 | 
						|
    date = json['date'];
 | 
						|
    siteTransferFrom = json['siteTransferFrom'];
 | 
						|
    siteTransferTo = json['siteTransferTo'];
 | 
						|
    transactionType = json['transactionType'];
 | 
						|
  }
 | 
						|
 | 
						|
  Map<String, dynamic> toJson() {
 | 
						|
    final Map<String, dynamic> data = <String, dynamic>{};
 | 
						|
    data['id'] = id;
 | 
						|
    data['nameOfType'] = nameOfType;
 | 
						|
    data['priority'] = priority;
 | 
						|
    data['status'] = status;
 | 
						|
    data['assetName'] = assetName;
 | 
						|
    data['assetNo'] = assetNo;
 | 
						|
    data['assetSN'] = assetSN;
 | 
						|
    data['model'] = model;
 | 
						|
    data['supplier'] = supplier;
 | 
						|
    data['manufacturer'] = manufacturer;
 | 
						|
    data['requestType'] = requestType;
 | 
						|
    data['requestNo'] = requestNo;
 | 
						|
    data['gasType'] = gasType;
 | 
						|
    data['site'] = site;
 | 
						|
    data['statusReceiver'] = statusReceiver;
 | 
						|
    data['assetTransferFrom'] = assetTransferFrom;
 | 
						|
    data['assetTransferTo'] = assetTransferTo;
 | 
						|
    data['code'] = code;
 | 
						|
    data['date'] = date;
 | 
						|
    data['siteTransferFrom'] = siteTransferFrom;
 | 
						|
    data['siteTransferTo'] = siteTransferTo;
 | 
						|
    data['transactionType'] = transactionType;
 | 
						|
    return data;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
class RequestQueryModel {
 | 
						|
  List<int>? typeTransaction;
 | 
						|
  List<int>? statusTransaction;
 | 
						|
  List<int>? priority;
 | 
						|
  List<int>? displayData;
 | 
						|
  int pageNumber;
 | 
						|
  int pageSize;
 | 
						|
  bool showLoader;
 | 
						|
 | 
						|
  RequestQueryModel({
 | 
						|
    this.typeTransaction,
 | 
						|
    this.statusTransaction,
 | 
						|
    this.priority,
 | 
						|
    this.displayData,
 | 
						|
    this.pageNumber = 1,
 | 
						|
    this.pageSize = 10,
 | 
						|
    this.showLoader = true,
 | 
						|
  });
 | 
						|
 | 
						|
  factory RequestQueryModel.fromJson(Map<String, dynamic> json) {
 | 
						|
    return RequestQueryModel(
 | 
						|
      typeTransaction: List<int>.from(json['typeTransaction']),
 | 
						|
      statusTransaction: List<int>.from(json['statusTransaction']),
 | 
						|
      priority: List<int>.from(json['priority']),
 | 
						|
      displayData: List<int>.from(json['displayData']),
 | 
						|
      pageNumber: json['pageNumber'] ?? 1,
 | 
						|
      pageSize: json['pageSize'] ?? 10,
 | 
						|
      showLoader: json['showLoader'] ?? true,
 | 
						|
    );
 | 
						|
  }
 | 
						|
 | 
						|
  Map<String, dynamic> toJson() {
 | 
						|
    return {
 | 
						|
      'typeTransaction': typeTransaction,
 | 
						|
      'statusTransaction': statusTransaction,
 | 
						|
      'priority': priority,
 | 
						|
      'displayData': displayData,
 | 
						|
      'pageNumber': pageNumber,
 | 
						|
      'pageSize': pageSize,
 | 
						|
      'showLoader': showLoader,
 | 
						|
    };
 | 
						|
  }
 | 
						|
 | 
						|
  String encodeToJson() => json.encode(toJson());
 | 
						|
 | 
						|
  static RequestQueryModel decodeFromJson(String jsonString) => RequestQueryModel.fromJson(json.decode(jsonString));
 | 
						|
}
 |