getresult_type2_npk function
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,
)
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;
}
}