chopper 8.0.0-rc.1 copy "chopper: ^8.0.0-rc.1" to clipboard
chopper: ^8.0.0-rc.1 copied to clipboard

Chopper is an http client generator using source_gen, inspired by Retrofit

example/main.dart

import 'package:chopper/chopper.dart';

import 'definition.dart';

Future<void> main() async {
  final chopper = ChopperClient(
    baseUrl: Uri.parse('http://localhost:8000'),
    services: [
      // the generated service
      MyService.create(ChopperClient()),
    ],
    converter: JsonConverter(),
  );

  final myService = chopper.getService<MyService>();

  final response = await myService.getMapResource('1');
  print(response.body);

  final list = await myService.getListResources();
  print(list.body);

  chopper.dispose();
}
778
likes
0
pub points
97%
popularity

Publisher

verified publisherhadrienlejard.io

Chopper is an http client generator using source_gen, inspired by Retrofit

Repository (GitHub)
View/report issues

Topics

#api #client #http #rest

Documentation

Documentation

License

unknown (LICENSE)

Dependencies

equatable, http, logging, meta, qs_dart

More

Packages that depend on chopper