positionAll method

Future<List<Map<String, dynamic>>> positionAll()

Implementation

Future<List<Map<String, dynamic>>> positionAll() async {
  Response resp = await _placeProvider.positionAllInfo();
  dynamic body = resp.body;

  Map<String, dynamic> convertBody = convertUtf8ToObject(body);
  List<Map<String, dynamic>> dat = [];
  for (dynamic d in convertBody["data"]) {
    dat.add(convertUtf8ToObject(d));
  }

  ServerMultiRespDto serverRespDto =
      ServerMultiRespDto.fromJson(convertBody, dat);

  if (serverRespDto.code == 1) {
    List<dynamic> temp = serverRespDto.data;
    List<Map<String, dynamic>> data = [];
    for (dynamic d in temp) {
      data.add(convertUtf8ToObject(d));
    }

    return data;
  } else {
    return [];
  }
}