dartrofit_generator 1.1.0 icon indicating copy to clipboard operation
dartrofit_generator: ^1.1.0 copied to clipboard


The Service code generator for dartrofit

The Service code generator for Dartrofit #

pub package

Generate an implementation for the Service interface annotated with @Service() or @service.

Example #

Given a library my_service.dart with a MyService class annotated with @Service():

import 'package:dartrofit/dartrofit.dart';

part 'my_service.g.dart';

abstract class MyService {

  factory MyService(Dartrofit dartrofit) = _$MyService;

  Future<Response<ResponseBody>> getBook(@Query('id') String id);

Building creates the corresponding part my_service.g.dart:

For Dart

pub run build_runner build

For Flutter

flutter pub run build_runner build

Download #

  build_runner: ^1.10.1
  build_verify: ^1.1.1
  dartrofit_generator: ^1.1.0