DCM provides a set of useful assists to speed up the refactoring process.
All listed assists are supported by both VS Code and IntelliJ / AS.
Wrap with ...
Wrap with custom widget assist allows you to set up the list of widgets that will be suggested to you when you call the assist menu in the IDE and a widget instance creation is selected.
This assist works close to the default "Wrap with Column" and "Wrap with Row", but is fully configurable to meet your needs.
To configure this assist, add the
assists entry to the
dart_code_metrics config section:
wrap-with list entry also support extended config options:
prop- the name of the property where the current widget should be passed (default is
list- a boolean flag indicating whether the
propaccepts an array of widgets (default is
target- a class name, for which the widget should be suggested (default is unset).
Example of a more advanced config:
MyOtherWidget be only suggested if a selected widget is an instance of
MyListWidget or its subclass. When this option is selected, the following code will be inserted
Extract class to a new file
Extract class to a new file assist allows you to quickly move the selected class to a new file.