I am building a project and I am trying to post and fetch data. I am doing this way, firstly, I login the app and I save id value by using SharedPreferences and I post this id value to URL. after I post to this URL, I want show the datas on my screen. but it gives me error, I will add codes and error to below:

class ServisProfil extends StatefulWidget {
  @override
  _ServisProfilState createState() => _ServisProfilState();
}

BekliyorModel bekliyorModelFromJson(String str) => BekliyorModel.fromJson(json.decode(str));

String bekliyorModelToJson(BekliyorModel data) => json.encode(data.toJson());

class BekliyorModel {
  int id;
  int ihaleId;
  String plakaNo;

  BekliyorModel({
    this.id,
    this.ihaleId,
    this.plakaNo,
  });

  factory BekliyorModel.fromJson(Map<String, dynamic> json) => BekliyorModel(
        id: json["id"],
        ihaleId: json["ihale_id"],
        plakaNo: json["plaka_no"],

      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "ihale_id": ihaleId,
        "plaka_no": plakaNo,

      };
}

Future<BekliyorModel> postAndFetchBekliyorDatas(
  String servisIdTitle,
  String kategoriTitle,
) async {
  final String apiUrl =
      "https://www.esr.com.tr/dart-login.php";

  final response = await http.post(apiUrl, body: {
    "kategori": kategoriTitle,
    "servis_id": servisIdTitle,
  });

  if (response.statusCode == 200) {
    final String responseString = response.body;

    return bekliyorModelFromJson(responseString);
  } else {
    return null;
  }
}

class _ServisProfilState extends State<ServisProfil> {
  BekliyorModel _id;
  BekliyorModel _ihaleId;
  BekliyorModel _plakaNo;

  Widget _buildBekliyor() {
    return Container(
      height: 60,
      child: RaisedButton(
          highlightElevation: 0,
          splashColor: Colors.transparent,
          elevation: 0,
          color: Colors.white,
          child: Container(
            alignment: Alignment.centerLeft,
            child: Text(
              'Bekliyor/Sonuçlanan',
              style: TextStyle(fontSize: 18, color: Colors.black),
            ),
          ),
          onPressed: () async {
            final prefs = await SharedPreferences.getInstance();
            final key = 'servis_id';

            final String servisIdTitle = prefs.getString(key).toString();
            final String kategoriTitle = 3.toString();

            final BekliyorModel user = await postAndFetchBekliyorDatas(
              servisIdTitle,
              kategoriTitle,
            );

            setState(() {
              _id = user;
              _ihaleId = user;
              _plakaNo = user;

            });

            _sendDataToBekliyor(context);

            print(servisIdTitle.toString());
          }),
      decoration: BoxDecoration(
        border: Border(
          bottom: BorderSide(
            width: 1,
            color: Colors.black12,
          ),
        ),
      ),
    );
  }

  void _sendDataToBekliyor(BuildContext context) {
    int idSend = _id.id;
    int ihaleIdSend = _ihaleId.ihaleId;
    String plakaNoSend = _plakaNo.plakaNo;

    Navigator.of(context).push(
      CupertinoPageRoute(
        builder: (context) => Bekliyor(
          idSend: idSend,
          ihaleIdSend: ihaleIdSend,
          plakaNoSend: plakaNoSend,

        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return _buildBekliyor();
  }
}

and this is screen that I want to see the datas:

class Bekliyor extends StatelessWidget {
  final int idSend;
  final int ihaleIdSend;
  final String plakaNoSend;

  Bekliyor({
    this.idSend,
    this.ihaleIdSend,
    this.plakaNoSend,
  });

Widget _buildBody() {
    return ListView.builder(
      itemCount: //WHAT I WILL WRITE,
      itemBuilder: (context, index) {
        return Container(
          margin: EdgeInsets.all(10),
          child: MaterialButton(
            splashColor: Colors.transparent,
            highlightColor: Colors.transparent,
            onPressed: () => Navigator.of(context).push(
              CupertinoPageRoute(
                builder: (context) => BekliyorDetay(),
              ),
            ),
            child: Column(
              children: <Widget>[
                Center(
                  child: Text(plakaNoSend.toString()),
                ),
                Center(
                  child: Text(ihaleNoSend.toString()),
                ),
                Center(
                  child: Text(idSend.toString()),
                ),

],
            ),
          ),
          decoration: BoxDecoration(
            color: Colors.grey[200],
            borderRadius: BorderRadius.circular(12.0),
            boxShadow: [
              BoxShadow(
                color: Colors.grey,
                offset: Offset(0.0, 1.0), //(x,y)
                blurRadius: 6.0,
              ),
            ],
            border: Border.all(width: 0.36, color: Colors.white),
          ),
        );
      },
    );
  }

 @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: _buildBody(),
    );
  }

and gives me this error:

[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: type 'List' is not a subtype of type 'Map<String, dynamic>'


Solution 1: Aikansh Mann

class OverviewModal {
int status;
String message;
List<OverviewData> overview;

OverviewModal({this.status, this.message, this.overview});

OverviewModal.fromJson(Map<String, dynamic> json) : status = json["status"], message = json["message"], overview = List.from(json["DetailList"]) .map((item) => OverviewData.fromJson(item)) .toList(); }

class OverviewData { String month; String voucherNumber; String voucherDate; String amount;

OverviewData.fromJson(Map<String, dynamic> json) : month = json["month"], voucherNumber = json["vocher_no"], voucherDate = json["vocher_date"], amount = json["amount"]; }

In my case overview is a type of list and DetailList holds a list data from backend and there is a way i used for list data.Hopefully you understand this.