Simplest way for apis integration in flutter without models controller

Опубликовано: 31 Март 2024
на канале: Stars Solutions
40
2

Simplest way for apis integration in flutter without any models controllers even future builders, You can fetch any data in this way .
*api function below if you face any issue you can comment on video i will reach as soon i can










Function: getSlider()async{
var request = http.Request('GET', Uri.parse(your api urls));


http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
// print(await response.stream.bytesToString());
//customize data according to our json
var res = await response.stream.bytesToString();
var body = jsonDecode(res);

setState(() {
//our list
data= body['response']['sliders'];
print("data = ${data}");
isLoading =false;
});
}
else {
print(response.reasonPhrase);
setState(() {
isLoading=false;
});
}

}


Смотрите видео Simplest way for apis integration in flutter without models controller онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Stars Solutions 31 Март 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 40 раз и оно понравилось 2 людям.