<p dir="auto">Feature request:<br>
Coming from Android background, a feature commonly used to perform complex tasks is annotation processors.</p>
<p dir="auto">Since Dart usage is moving to the strong side such a feature can enable all sorts of code generation previous to user code compilation, which is very valuable to catch errors early on with compilation checks. Some of the existing Android libraries are starting to pop up, but instead the user has to manually perform the code generation step and (probably) commit those files to disk.</p>
<ul dir="auto">
<li><a href="https://github.com/google/inject.dart/tree/master/example/coffee">https://github.com/google/inject.dart/tree/master/example/coffee</a></li>
<li><a href="https://github.com/IdanAizikNissim/Cosmic">https://github.com/IdanAizikNissim/Cosmic</a></li>
</ul>
<p dir="auto">Not yet in Flutter there are some good sources for inspiration</p>
<ul dir="auto">
<li>Android's Room database's highlights come from annotation processor to generate code and validate user code</li>
<li>I also have plans to scan the assets and generate code to access them from a class with fields (inspired by Android's asset system - R.drawable.bunny). If an automated tool that runs pre-build is available I can hook into that, but otherwise the only way is to modify packages/flutter_tools (related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="164942550" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/4890" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/4890/hovercard" href="https://github.com/flutter/flutter/issues/4890">#4890</a>)</li>
</ul>
<p dir="auto">It's not sustainable for the <code class="notranslate">flutter</code> tool to support all the commands that all developers collectively desire. It's much more sustainable to support an extensibility model where the tool itself can be extended by adding in "tools plugins".</p>
<ul dir="auto">
<li>Run Dart commend / do codegen: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="282499082" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/13607" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/13607/hovercard" href="https://github.com/flutter/flutter/issues/13607">#13607</a></li>
<li>Generate app icon: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="232242970" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/10387" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/10387/hovercard" href="https://github.com/flutter/flutter/issues/10387">#10387</a></li>
<li>Determining the size of an app: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="276477473" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/13189" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/13189/hovercard" href="https://github.com/flutter/flutter/issues/13189">#13189</a></li>
<li>Customize the build: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="226811271" data-permission-text="Title is private" data-url="https://github.com/flutter/flutter/issues/9870" data-hovercard-type="issue" data-hovercard-url="/flutter/flutter/issues/9870/hovercard" href="https://github.com/flutter/flutter/issues/9870">#9870</a></li>
</ul>