简体   繁体   English

在 Android Studio Flutter 项目的上下文菜单中用未显示的列换行

[英]Wrap with column not showing in context menu in Android Studio Flutter project

I've been trying to learn flutter, but I keep getting problems not with the code, but with the behaviour of the IDEs.我一直在尝试学习 flutter,但我总是遇到问题,不是代码问题,而是 IDE 的行为问题。 I've spent considerably more time (feels like at least 10x the amount) trying to fix issues that actually have nothing to do with the code.我花了相当多的时间(感觉至少是 10 倍)试图解决实际上与代码无关的问题。

My current problem is that I've seen several tutorials where the instructor highlights the scaffold widget in code, right clicks and goes 'wrap with Column'.我目前的问题是,我看过几个教程,其中讲师在代码中突出显示脚手架小部件,右键单击并“用列包裹”。 That option simply isn't there for me, so I'm having trouble following the guide.该选项根本不适合我,因此我无法按照指南进行操作。

I even tried to do this with the shortcut ctrl+.我什至尝试使用快捷键 ctrl+ 来做到这一点。 in VScode, and that doesn't show me a wrap column option either.在 VScode 中,这也没有显示换行列选项。 I could just write the code manually, copying what happens when the instructor uses the context menu, but I feel I shouldn't have to.我可以手动编写代码,复制讲师使用上下文菜单时发生的情况,但我觉得我不应该这样做。 Any ideas?有任何想法吗?

Here is what the instructor sees这是导师看到的

And here is what I see这就是我所看到的

Just make sure Scope analysis to the current package in Dart Analysis Server Settings is checked.只要确保Dart分析服务器设置的Scope分析到当前package被选中。

  1. Just at the bottom of Android Studio, go to Dart Analysis -> Analyser Settings就在 Android Studio 的底部,go 到 Dart Analysis -> Analyzer Settings

  2. Check Scope analysis to the current package查看Scope分析到当前package

Check the image here for details查看此处的图片了解详细信息

Put your cursor at the last letter of the widget name.将您的 cursor 放在小部件名称的最后一个字母处。

For example:例如:

child: TextFormField(
          style: TextStyle(
            color: Colors.white,
          ),

to show "Wrap with column or row menu" put your cursor at the last character of TextFormField.要显示“使用列或行菜单换行”,请将 cursor 放在 TextFormField 的最后一个字符处。 (between d letter and "(") (在 d 字母和“(”)之间

wrap with column will show like this用列换行将显示如下

Ok, so it turns out you need to only right-click the widget name and not highlight the widget and then right click.好的,事实证明您只需要右键单击小部件名称而不突出显示小部件然后右键单击。 Wrap in column showed as soon as I did this.一旦我这样做,就会显示在列中的换行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM