getPOI method

Future<GetPoi?> getPOI(
  1. String finalToken
)

Implementation

Future<GetPoi?> getPOI(String finalToken) async {
  print("finalToken $finalToken");
  var body = {"appname": "bom", "secret": finalToken};
  final headers = {
    'Content-Type': 'application/json',
  };
  final jsonString = json.encode(body);

  http.Response response;
  try {
    response = await http.post(
        Uri.parse("https://adl.wisefly.in/poisroute/getpois"),
        headers: headers,
        body: jsonString);

    if (response.statusCode == 200) {
      poiData = GetPoi.fromJson(jsonDecode(response.body));

      return poiData;
    } else {
      return null;
    }
  } catch (e) {
    throw e.toString();
  }
}