tectonic_chopper 3.0.4 copy "tectonic_chopper: ^3.0.4" to clipboard
tectonic_chopper: ^3.0.4 copied to clipboard

outdated

Tectonic Chopper is an http client generator using source_gen and inspired from retrofit

example/main.dart

import 'package:tectonic_chopper/tectonic_chopper.dart';
import 'package:tectonic_chopper/src/interceptor.dart';
import 'definition.dart';

Future<void> main() async {
  final chopper = ChopperClient(
    baseUrl: 'http://localhost:8000',
    services: [
      // the generated service
      MyService.create()
    ],
    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();
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Tectonic Chopper is an http client generator using source_gen and inspired from retrofit

Homepage
Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

http, logging, meta

More

Packages that depend on tectonic_chopper