Want to run source_gen
? You need a file tool/build.dart like, to generate the model classes like below example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | // Copyright (c) 2016, Google Inc. Please see the AUTHORS file for details. // All rights reserved. Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. import 'dart:async'; import 'package:build_runner/build_runner.dart'; import 'package:built_value_generator/built_value_generator.dart'; import 'package:source_gen/source_gen.dart'; /// Build the generated files in the built_value chat example. Future main(List<String> args) async { await build( new PhaseGroup.singleAction( new GeneratorBuilder([ new BuiltValueGenerator(), ]), new InputSet('chat_example', const ['lib/**/*.dart'])), deleteFilesByDefault: true); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.