Questions tagged [chopper]
42 questions
4
votes
1 answer
Flutter access BloC without Context
I have a problem with my BloC provider in one of my Flutter applications. I use Chopper as HTTP client and it creates a Chopper instance right at the beginning of the app which I then inject with get_it wherever I want to fetch data from my API. In…

morzan1001
- 73
- 4
4
votes
1 answer
Flutter Bloc Builder is not getting called and not updating UI after state change
I have a problem with Flutter Bloc package. Main idea is to get list of users from API, I turned of the internet to see how my Error state works, but when try/catch block catches an error my Bloc Builder is not getting rebuilt and my UI isn't…

Donatas
- 123
- 2
- 6
4
votes
2 answers
How to send file using Chopper?
In my kotlin project, I use retrofit and it works well.
suspend fun createPlan(
context: Context?,
name: String,
file: File?
): ABC? {
val fileSignImage = file?.let {
MultipartBody.Part.createFormData(
"image",
…

Hoo
- 1,806
- 7
- 33
- 66
3
votes
0 answers
Flutter Chopper: how to create a client with multiple services?
At the moment I have these codes:
import 'package:chopper/chopper.dart';
part 'first_api.chopper.dart';
@ChopperApi(baseUrl: '')
abstract class FirstApi extends ChopperService {
@Get(path: '/api/v1/mobile/first/')
Future…

stacktrace2234
- 1,172
- 1
- 12
- 22
3
votes
3 answers
Flutter Chopper 401 renew & retry interceptor
I'm using Chopper in my flutter app and what I need to do is, when I get 401 response status code (unauthorized) from my API, I must call another endpoint that will refresh my token and save it into secured storage, when all of this is done, I need…

therealsowho
- 133
- 1
- 7
3
votes
0 answers
What is the best way of creating Chopper Clients on Flutter/Dart?
I'm using Chopper for http request on Flutter and as far as I know, there are two ways of creating a Chopper Client. One is adding services to its array and then expose it:
// my_chopper_client.dart
static ChopperClient getClient() {
final…

Sinuhé Valencia
- 31
- 1
- 4
3
votes
4 answers
Bad state: Unexpected diagnostics: after flutter upgrade to 1.20.1
What is the issue?
xxx@xxx-Inspiron-14-3467:~/xxx$ flutter pub run build_runner build[INFO] Generating build script...
[INFO] Generating build script completed, took 406ms
[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO]…

John Joe
- 12,412
- 16
- 70
- 135
3
votes
1 answer
Flutter + Chopper POST API not working in web
I am completely new to flutter. While learning flutter I am not able to login with flutter web application same code is working fine with the android mobile app.
Please find the below log info. The same call is working on all platforms except…

Raja Peela
- 1,366
- 2
- 14
- 26
3
votes
1 answer
Instance of 'Response' flutter Api Consumption
I am trying to make a post request in flutter using chopper. I have made an ApiService.dart file as
a generator file.
import 'package:bindle/Chopper/Models/LoginResponse.dart';
import 'package:chopper/chopper.dart';
part…

Arpit Todewale
- 129
- 2
- 11
3
votes
1 answer
Dart Flutter - fetching WordPress Custom Post Type using Chopper
I am building a mobile with Google Flutter Framework and using Wordpress as the backend for my app.
I want to fetch Wordpress Custom Post Type data in JSON format in Flutter with Chopper Retrofit of Flutter API.
Can anyone help me to build a sample…

Mayanktaker
- 175
- 5
- 14
2
votes
0 answers
is there a way to automatically convert chopper response body to dart model object?
I have been manually converting chopper api response response.body and was wondering if its possible to automatically make a way to convert whatever type of response to whatever dart model object I have.
Below are ways I want to do the conversion of…

z4rtx
- 127
- 1
- 8
2
votes
1 answer
How do I use json_serializable with Chopper?
I'm trying to figure out how to use Chopper with json_serializable but there isn't much documentation about it. I'm looking at the example from the Chopper GitHub and I don't know what I'm meant to use as an argument for the…

UnicornsOnLSD
- 631
- 6
- 24
2
votes
1 answer
Convert error responses to a specific Model - Chopper flutter
i use chopper client for make http requests
I written a api, and it have to types of response:
success with this format:
{
"id": 1,
"title": "Most Popular phone in the world !",
"image": "/uploads/poll_images/D6voYQriTCSZpMIe.jpg",
…

morteza mohammady
- 182
- 1
- 7
1
vote
1 answer
Flutter Web - Can't change GET request's referer in header
I'm trying to call a GET request using chopper with a custom referer. But everytime it calls, it only uses the default referer. I added a custom header and it still works

Chris Maverick
- 928
- 1
- 8
- 18
1
vote
0 answers
How to add add SSL .cert to chopper client?
In flutter I try to create with chopper a request to a backend url.
To my ChopperClient I try to provide a TLS certificate. I have the certificate
as a file tls.cert
How do I add this to my chopper requests?

Lingo
- 580
- 2
- 7
- 26