Open gushendra86 opened 3 years ago
@jonataslaw hi, any updates?
@gushendra86 i use temporary solution like below.
try {
var response = await post(url+'/student/addStudent', postData).timeout(
Duration(seconds: 5)
);
} on TimeoutException catch (_) {
// catch timeout here..
} catch (e) {
// error
}
Hello,
Is there any updates for getConnect ? @jonataslaw
Thanks
Just a quick check, did you injected the dependency with Get.put or Get.lazyPut?
For me, i am using Get.lazyPut in the Bindings.
For me, this issue was caused by having the Controller before the Provider in the Binding.
Putting Provider first fixed this issue for me, as below:
class MyBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut<MyProvider>(
() => MyProvider(),
);
Get.lazyPut<MyController>(
() => MyController(),
);
}
}
and then in your provider call, get, post etc on httpClient
httpClient.get(
'home',
);`
Still not working for me @LukeStanyer
the same here. it's urgent, please...
@astheras alternatively you can manually call onInit(); but of course this is not the best way
i already have this
@override
void onInit() {
httpClient.timeout = const Duration(seconds: 60);
super.onInit();
}
but it doesn't work
I gues the current timeout setting is only for connecting timeout. Not for receiving data timeout. If we sleep the process on the server will not take effects. Because the connection already connected before timeout reached.
I hope willbe more timeout setting in getConnect. Separated setting for connecting timeout, and receiving data timeout
I had the same problem, i solved it setting the timeout in my class:
RestClient extends GetConnect {
RestClient() {
baseUrl = "my-url";
timeout = const Duration(seconds: 30);
maxAuthRetries = 3;
}
}
I had the same problem, i solved it setting the timeout in my class:
RestClient extends GetConnect { RestClient() { baseUrl = "my-url"; timeout = const Duration(seconds: 30); maxAuthRetries = 3; } }
Flutter beginner here to the downvoters: What's wrong with this approach?
I had the same problem, i solved it setting the timeout in my class:
RestClient extends GetConnect { RestClient() { baseUrl = "my-url"; timeout = const Duration(seconds: 30); maxAuthRetries = 3; } }
Flutter beginner here to the downvoters: What's wrong with this approach?
Hi Sebastian,
For me personally, this is far to long for an app. Is a user really going to wait more than say, 2 secs vs 1 and a half mins?
Have a listen to this https://www.se-radio.net/2020/09/episode-428-matt-lacey-on-mobile-app-usability/ and enjoy reading this excellent book https://www.manning.com/books/usability-matters
Both talk about design patterns and UX.
Ah, I see! It’s the value you’ve something against, not the form. I don’t want to judge the value, since I don’t know the particular usecase. 😅
Hi @gushendra86 @jasonlaw Has this bug been closed yet?
Hello,
I think it still have a bug at GetConnect when using timeout on get 4.3.8.
i write this code on base_provider.dart
And then on UserProvider i write this :
There are 2 error :
And is there a callback when the timeout is triggered ? For example i want to show toast and close progress dialog when the http request is timeout.
Thank you and kind regards