flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 318 forks source link

Can't wrap widget list with new widget assist by Alt+Enter #2448

Closed petchpool closed 6 years ago

petchpool commented 6 years ago

Use on OSX system.

Steps to Reproduce

  1. Press Alt+Enter on Android Studio.
  2. Nothing appears.
pq commented 6 years ago

Hi @wisit-phusi. Thanks for the report.

What version of IDEA and the plugin are you using? How recent is your Flutter? Could you run flutter doctor and paste in the output?

petchpool commented 6 years ago

I use IntelliJ IDEA 2018.1.4, Android Studio 3.1.3, Flutter Plugin version 25.0.1 and Dart Plugin version 173.4700.

Flutter Doctor

[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.5 17F77, locale en-TH)
    • Flutter version 0.5.1 at /Users/Wisit/flutter
    • Framework revision c7ea3ca377 (4 weeks ago), 2018-05-29 21:07:33 +0200
    • Engine revision 1ed25ca7b7
    • Dart version 2.0.0-dev.58.0.flutter-f981f09760

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/Wisit/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.2

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 25.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 24.2.2
    • Dart plugin version 181.4892.1

[✓] VS Code (version 1.24.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.13.2

[!] Connected devices
    ! No devices available

! Doctor found issues in 1 category.
pq commented 6 years ago

Thanks!

@wisit-phusi : does it work unreliably or never?

Anything in the error log? (Help > Show Log in Finder)

/cc @scheglov

scheglov commented 6 years ago

Do you have an example when it does not work? I tried it now manually (and we have tests), and it still works. image

petchpool commented 6 years ago

I have tried to do this, But it still not appeared. I don’t sure that I have ever disabled it before. Has its way to check that enable or disable?

petchpool commented 6 years ago

@scheglov This is an example when it does not work.

screen shot 2561-06-30 at 01 06 32
scheglov commented 6 years ago

Do you get any Dart Quick Assists (Alt+Enter) from IDE?

petchpool commented 6 years ago

Android Studio and Intellij

On Sat, 30 Jun 2561 at 01:21 Konstantin Scheglov notifications@github.com wrote:

Do you get any Dart Quick Assists (Alt+Enter) from IDE?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/flutter/flutter-intellij/issues/2448#issuecomment-401434924, or mute the thread https://github.com/notifications/unsubscribe-auth/AfHTeq68xZz_fU7hS0YBZaWDHugV5hhOks5uBnBAgaJpZM4U8aNz .

scheglov commented 6 years ago

Sorry, I see that you use Android Studio, but that's not what I asked. Do you get any Dart specific assists / intentions at all? I.e. maybe it is not a Flutter wrapping specific problem, but something fundamental with quick assists?

quangson91 commented 6 years ago

@wisit-phusi I thought you may disable Dart Quick Assists (Alt+Enter) from IDE.

disable

To make sure, please open intellij/androidstudio setting page. In search text book type assistant. Then check in Editor -> Intentions -> You should checked Quick assist powered by the Dart Analysis Server..

Here is the screenshot for more detail.

check
petchpool commented 6 years ago

@quangson91 Thanks, I have been able to use it already.

srinivasPaidisetti commented 5 years ago

thank you very much I had the same issue occurred. So, I followed the above steps u said Then it works fine

francyfre commented 5 years ago

in Android studio, when i close my widgets... there is no name in last brackets (name of the widget close)... i have suggest when i use alt+enter... so i dont know whats problem is!

thankForHelpMe

lijie28 commented 5 years ago

@wisit-phusi I thought you may disable Dart Quick Assists (Alt+Enter) from IDE.

disable

To make sure, please open intellij/androidstudio setting page. In search text book type assistant. Then check in Editor -> Intentions -> You should checked Quick assist powered by the Dart Analysis Server..

Here is the screenshot for more detail.

check

thanks,it really helps

Kav47 commented 4 years ago

It happens when you try to wrap a list of widgets like this:

.............
           Expanded(
                child: FlatButton(
                  onPressed: (){
                    playSound(5);
                  },
                  color: Colors.teal,
                ),
              ),
              FlatButton(
                onPressed: (){
                  playSound(6);
                },
                color: Colors.blue,
              ),
............

Here I just wrapped my first FlatButton widget with Expanded, now there is a red color box around my Expanded widget.

image

When I try to wrap my second FlatButton widget by Alt+Enter or Option+ Enter (mac), it will not work as the red box is still around my Expanded widget. In order yo get rid of it press Tab (once or twice-if you have a child entry).

I don't think this is a bug, I guess this is how Android studio works.

TL;DR: This only happens if there is a red box around the newly wrapped Widget. To sort out press Tab (once or twice).

sokkhimk commented 4 years ago

@wisit-phusi I thought you may disable Dart Quick Assists (Alt+Enter) from IDE.

disable

To make sure, please open intellij/androidstudio setting page. In search text book type assistant. Then check in Editor -> Intentions -> You should checked Quick assist powered by the Dart Analysis Server..

Here is the screenshot for more detail.

check

Thank you for solution. It 's work for me.

lifeanddeath commented 4 years ago

Hi everyone, I followed the aforementioned solution, but unfortunately it still doesn't work for me. The problem with mine is that if i click on the widget, i get a yellow bulb appearing on the left hand side and i can go over with mouse and click on whatever widget I want. But this is extremely time consuming and annoying after a while, so i wanna do it with alt+ enter combination but then i get only suggestions for java. how am i suppose to fix this? could possibly someone help me for gods sake pls?

Screenshot 2020-04-25 at 22 04 12 Screenshot 2020-04-25 at 22 03 50 1

Whoever might have the same problem like I did can solve it by following:

### Solution I found later on: Open keyboard shortcuts menu and search after : Show context Actions, and then assign a key-value to this action :)

Deepanshu-Rohilla commented 4 years ago

Thank you very much...

asheshpaul commented 4 years ago

@wisit-phusi I thought you may disable Dart Quick Assists (Alt+Enter) from IDE.

disable

To make sure, please open intellij/androidstudio setting page. In search text book type assistant. Then check in Editor -> Intentions -> You should checked Quick assist powered by the Dart Analysis Server..

Here is the screenshot for more detail.

check

Thank you very much

mochammadfawwaz commented 4 years ago

image

hey bro i have same problem but in my case im use vscode.. can you help me to fix this? i cant automatically add "refactor -> wrap with column"

thank youu

felipecastrosales commented 4 years ago

@ wisit-phusi achei que você pode desativar Dart Quick Assists (Alt+Enter) from IDE.

desabilitar

Para ter certeza, abra a página de configuração do intellij / androidstudio. No tipo de livro de texto de pesquisa assistant. Em seguida, verifique Editor -> Intentions-> Você deve verificar Quick assist powered by the Dart Analysis Server..

Aqui está a imagem para mais detalhes.

Verifica

@ wisit-phusi achei que você pode desativar Dart Quick Assists (Alt+Enter) from IDE.

desabilitar

Para ter certeza, abra a página de configuração do intellij / androidstudio. No tipo de livro de texto de pesquisa assistant. Em seguida, verifique Editor -> Intentions-> Você deve verificar Quick assist powered by the Dart Analysis Server..

Aqui está a imagem para mais detalhes.

Verifica

WOW! Thank You!

SandaliTharuki commented 4 years ago

I'm having a similar issue. When I press ALT + Enter I get other options without "Wrap with a new widget' which I want to use here. Please can someone help me?

babyguy commented 3 years ago

@ wisit-phusi Pensé que podrías desactivar Dart Quick Assists (Alt+Enter) from IDE.

inhabilitar

Para asegurarse, abra la página de configuración de intellij / androidstudio. En el tipo de libro de texto de búsqueda assistant. Luego regístrese Editor -> Intentions-> Debería verificarlo Quick assist powered by the Dart Analysis Server..

Aquí está la captura de pantalla para más detalles.

cheque

Gracias colega tenia mucho tiempo esa duda :+1:

thecodeline commented 3 years ago

From the top navbar click on file -> settings -> intentions then search for ( your desired programming language and then check the option, it should work without restarting android studio

thecodeline commented 3 years ago

I'm having a similar issue. When I press ALT + Enter I get other options without "Wrap with a new widget' which I want to use here. Please can someone help me?

From the top navbar click on file -> settings -> intentions then search for ( your desired programming language and then check the option, it should work without restarting android studio

FrenchFries-French commented 3 years ago

Hey guys, seem that I have a similar Problem. I also clicked on Preferences and checked the box "Quick" as mentioned several times but I still only get this, when I press alt + enter:

adjust code style settings

Can someone help me please ?

ukreddy-erwin commented 3 years ago

image neither alt+enter also working

pilotsis commented 2 years ago

@wisit-phusi devre dışı bırakabileceğinizi düşündüm Dart Quick Assists (Alt+Enter) from IDE. devre dışı bırakmak

Emin olmak için lütfen intellij/androidstudio ayar sayfasını açın. Arama metin kitabı türünde assistant. sonra giriş yap Editor -> Intentions-> Kontrol etmelisin Quick assist powered by the Dart Analysis Server..

İşte daha fazla ayrıntı için ekran görüntüsü.

Kontrol

Thank you so mach. I've been dealing wtih problem for two days.

Amr1440 commented 2 years ago

@wisit-phusi I thought you may disable Dart Quick Assists (Alt+Enter) from IDE. disable

To make sure, please open intellij/androidstudio setting page. In search text book type assistant. Then check in Editor -> Intentions -> You should checked Quick assist powered by the Dart Analysis Server..

Here is the screenshot for more detail.

check

Tried solution but it didnt work coz it was already clicked

ZapeeoSheikh commented 2 years ago

I am unable to solve this problem. As the Intentions tab is not shown to my android studio

ZapeeoSheikh commented 2 years ago

Oh that's great my problem has been solved now let me share my problem and their solution: I was unable to find my intention in the search of " assistant " solution go to file > setting > search [ type "int" and press search } > intentions > check the box of " dart "

Done

Nguyen-Duc-Hoa commented 2 years ago

@wisit-phusi I thought you may disable Dart Quick Assists (Alt+Enter) from IDE. disable

To make sure, please open intellij/androidstudio setting page. In search text book type assistant. Then check in Editor -> Intentions -> You should checked Quick assist powered by the Dart Analysis Server..

Here is the screenshot for more detail.

check

thanks, it worked

KartikPatadiya commented 1 year ago

@quangson91 Thank You So much

Qikcasual commented 1 year ago

@quangson91 bro very very thanks full to you!! because, i am new on Android development!! i am struggled on this so many days!!! now problem solved!!!

almasud commented 1 year ago

@wisit-phusi I thought you may disable Dart Quick Assists (Alt+Enter) from IDE. disable

To make sure, please open intellij/androidstudio setting page. In search text book type assistant. Then check in Editor -> Intentions -> You should checked Quick assist powered by the Dart Analysis Server..

Here is the screenshot for more detail.

check

I have the same issue even though the Quick assist powered by the Dart Analysis Server is already enabled on my Android Studio Giraffe | 2022.3.1 Patch 1 for MacOS !

Zeeshan-H commented 9 months ago

Same problem for me too. Even i am using Android Studio Giraffe and visual studio code too but flutter refactorings not working. For instance i can't wrap a widget.

ghost commented 8 months ago

In my case, I uninstalled this plugin and now my alt + enter works fine. Plugin : Bloc , Clean architecture Screenshot 2024-02-13 at 12 26 25 ### PM

tmunier commented 7 months ago

The solution for me was the shortcut "command" + "." (Mac)

IanMurnane commented 6 months ago

If you can't see File -> Settings -> Intentions, use the search bar

I had to disable quick assist, apply, click reset, re-enable, apply, ok.. then it started working!