getresult_type2_npk function

Future getresult_type2_npk(
  1. String url,
  2. String weight,
  3. String n_rate,
  4. String p_rate,
  5. String k_rate,
  6. String weight_1,
  7. String weight_2,
  8. String weight_3,
  9. String province_id,
  10. String district_id,
  11. String address,
  12. List<int> list,
)

Implementation

Future getresult_type2_npk(String url,String weight, String n_rate, String p_rate, String k_rate,String weight_1,String weight_2,String weight_3,String province_id,String district_id,String address, List<int> list) async {
  try {
    NpkResult result;
    bool logout = true;
    http.Response response =
    await http.get(Uri.parse('${url}/api/v2/npk_manures/npk_calculator_reverse?weight=${weight}&n_rate=${n_rate}&p_rate=${p_rate}&k_rate=${k_rate}&weight_1=${weight_1}&weight_2=${weight_2}&weight_3=${weight_3}&npk_manures_1=${list[0]}&npk_manures_2=${list[1]}&npk_manures_3=${list[2]}&province_id=${province_id}&district_id=${district_id}&calculation_type=convert&address=${address}')
    );
    if((json.decode(response.body))['success']){
      result = NpkResult.fromJson((json.decode(response.body))['data']);
      return result;
    } else {
      return logout;
    }
  } catch (e) {
    rethrow;
  }
}