Introduction

dartness_generator is used with dartness_server in order to provide the code generation for some annotations

Generating code

  1. Add dartness_generator together with build_runner in dev_dependencies also add dartness_server in the dependency section in the pubspec.yaml
dependencies:
  dartness_server: ^0.7.0

dev_dependencies:
  build_runner: ^2.2.0
  dartness_generator: ^0.7.2
  1. Add the corresponding part '.g.dart' to your classes, otherwise the new code won't be generated, you can find an example in the following code:

part 'city_controller.g.dart';

@Controller('/cities')
class CityController {
  @Get()
  String getCities() {
    return 'This action returns a list of cities';
  }
}
  1. Go to the root of your project and execute the following command:
$ dart run build_runner build