update method

Future<void> update(
  1. File file
)

Update a file and generate if the analysis succeeds.

You may override the generate method to specify how to generate according to the source code file. If the analysis failed, it will do nothing.

Implementation

Future<void> update(File file) async {
  switch (await resolve(file)) {
    case final ResolvedUnitResult result:
      generate(file, result.unit);
    default:
  }
}