jaguar_retrofit_gen

Last updated:

0 purchases

jaguar_retrofit_gen Image
jaguar_retrofit_gen Images
Add to Cart

Description:

jaguar retrofit gen

jaguar_http_cli #
An Http Api generator inspired by Retrofit for Dart
Install #
pub global activate jaguar_http_cli
Usage #
A simple usage example:
pubspec.yaml
jaguar_http:
- example/example.dart
copied to clipboard
example.yaml
library example;

part 'example.g.dart';

/// definition
@JaguarHttp(name: "Api")
abstract class ApiDefinition extends JaguarInterceptors {
@Get("/users/:id")
Future<JaguarResponse<User>> getUserById(@Param() String id);

@Post("/users")
Future<JaguarResponse<User>> postUser(@Body() User user);

@Put("/users/:uid")
Future<JaguarResponse<User>> updateUser(@Param(name: "uid") String userId, @Body() User user);

@Delete("/users/:id")
Future<JaguarResponse> deleteUser(@Param() String id);
}
copied to clipboard
run
jaguar_http build
use it
final api = new Api(new IOClient(), "http://localhost:9000", serializers: repo);
copied to clipboard
Features and bugs #
Please file feature requests and bugs at the issue tracker.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.