chopper_client_wrapper 1.0.0+1 chopper_client_wrapper: ^1.0.0+1 copied to clipboard
This package is a wrapper class that you can use to save time while setting up files for integrating apis. You just have to extend our class and follow the steps.
import 'dart:async';
import 'package:chopper/chopper.dart';
import 'package:chopper_client_wrapper/ChopperService/ChopperClientWrapper.dart';
void main() {}
class MyChopperClient extends ChopperClientWrapper {
@override
Map<Type, JsonConvertorFunction> get jsonToModelConvertorMap =>
throw UnimplementedError();
@override
Map<Type, JsonConvertorFunction> get jsonToErrorModelConvertorMap =>
throw UnimplementedError();
@override
String get baseUrl => 'https://myapi.com';
@override
List<ChopperService> get chopperServices => [
// List of Chopper services that you create for your application
];
@override
FutureOr<String> getToken() {
// Override this method to get the token that can be passed to the header
return 'mytoken';
}
}