Flutter Plugin技巧

Wrap Widget

当已经存在一个widget,你想用另外一个widget包装的时候非常有用,比如想包在Row或者Column中,可以使用快捷键包装控件

快捷键

  • Linux and Windows: Alt+Enter
  • macO: Option+Return

wrap

Wrap with new widget assist This can be used when you have a widget that you want to wrap in a surrounding widget, for example if you want to wrap a widget in a Row or Column.

Wrap widget list with new widget assist Similar to the assist above, but for wrapping an existing list of widgets rather than an individual widget.

Convert child to children assist Changes a child argument to a children argument, and wraps the argument value in a list.

Live Templates

  • Prefix stless: Create a new subclass of StatelessWidget.
  • Prefix stful: Create a new subclass of StatefulWidget and it’s associated State subclass.
  • Prefix stanim: Create a new subclass of StatefulWidget, and it’s associated State subclass including a field initialized with an AnimationController.

template

Cheet Sheet

cheet