Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
2.3 kB
2
Indexable
Never
// To parse this JSON data, do
//
//     final bankData = bankDataFromJson(jsonString);

import 'dart:convert';

BankData bankDataFromJson(String str) => BankData.fromJson(json.decode(str));

String bankDataToJson(BankData data) => json.encode(data.toJson());

class BankData {
    int status;
    String message;
    String accessToken;
    List<Datum> data;

    BankData({
        required this.status,
        required this.message,
        required this.accessToken,
        required this.data,
    });

    factory BankData.fromJson(Map<String, dynamic> json) => BankData(
        status: json["status"],
        message: json["message"],
        accessToken: json["access_token"],
        data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
    );

    Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "access_token": accessToken,
        "data": List<dynamic>.from(data.map((x) => x.toJson())),
    };
}

class Datum {
    String id;
    String value;
    String name;
    String sequence;
    String minamt;
    String feepercent;
    String image;
    String emoney;
    String debit;
    String credit;
    String rekon;

    Datum({
        required this.id,
        required this.value,
        required this.name,
        required this.sequence,
        required this.minamt,
        required this.feepercent,
        required this.image,
        required this.emoney,
        required this.debit,
        required this.credit,
        required this.rekon,
    });

    factory Datum.fromJson(Map<String, dynamic> json) => Datum(
        id: json["id"],
        value: json["value"],
        name: json["name"],
        sequence: json["sequence"],
        minamt: json["minamt"],
        feepercent: json["feepercent"],
        image: json["image"],
        emoney: json["emoney"],
        debit: json["debit"],
        credit: json["credit"],
        rekon: json["rekon"],
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "value": value,
        "name": name,
        "sequence": sequence,
        "minamt": minamt,
        "feepercent": feepercent,
        "image": image,
        "emoney": emoney,
        "debit": debit,
        "credit": credit,
        "rekon": rekon,
    };
}
Leave a Comment