build_runner

    If you’re a web developer: You can use the instead of directly using build_runner to build and serve web apps.

    The buildrunner commands work with _builders—packagesthat use the Dart build systemto generate output files from input files.For example, the and built_value_generatorpackages define builders that generate Dart code.

    To use build_runner, add a on build_runnerto your app’s pubspec:

    Depending on build_test is optional; do it if you’ll be testing your code.

    How you use the build_runner commands depends on whether you’re usingthe Dart SDK or the Flutter SDK.Here are examples of using the build_runner build command:

    The build_runner package includes the following commands:

    • build
    • serve
    • Runs a development server.Instead of directly using this command,you can use webdev serve,which has convenient default behavior.
    • test
    • Runs
    • Launches a build server that watches for edits to input files.Responds to changes by performing incremental rebuilds.

    For details on using build_runner, see the following: