shortcut to see all the properties of widget in flutter - android-studio

I m new at flutter, I m using android studio and I want to know is there is any shortcut to see all the property of any particular widget at the time android studio it self, without going to the documentation page.pls help, it really help to reduce the development time.

In my case it's ctrl + space. But I'm not using apple's mac mini keyboard.
So "In my case" ctrl + space is the most useful. Then you can click on some widget e.g Text and press ctrl + j to see documentation. You can also press cmd + p to see all properties in inline mode.

This feature is called Code Completion:
On my MacbookPro & Android Studio Smart Code Completion -> fn+^+space was working. However Basic key shortcut ^+space was shadowed by MacOs keyboard input settings. So disabling the select the previous input source solved this shadowing. Now both shortcuts are working.

In Mac it's (control + J), if not working go to preferences or settings, then head to keymap, and then there search for documentation. you will get the shortcut.
Also try ( command + p ), I think that would work for what you are trying to find.

Related

Shortcut alt+enter is not working in Android Studio

alt + enterfor importing was work normally maybe until I updated Android Studio,
my version now is2.3.3
as this screenshot, I can't press alt + enter at all, knowing that I have tested them on other programs and they are working normally
Use LEFT Alt Key + Enter. It works well in Android Studio 3.0.1.
I encountered the same problem today, this is how I solved it.
Go to File > Settings > Editor > General > Auto Import
Uncheck and Check Show Import Popup
Do Invalidate caches and Restart of Android Studio. (If this option doesn't work, restart your computer
Edit
Another solution I've found to work is to uninstall Android Studio and reinstall it.
Try "the Windows Key + Alt + Enter" if you are using windows.
It feels weird as I am pretty sure my keyboard works fine and android studio settings are alright, but I just see the pop-up suggestion for class import and nothing happens when I press Alt+Enter.
I work on Windows 10 and my Android SDK is on a different hard drive(E:) from the Android Studio installation(C:), not sure if these contribute to the problem.
After some trial and error I accidentally solved the problem by pressing "the Windows Key + Alt + Enter" to conjure the import class menu and could then press Enter again to properly import the suggested class.
In the Android studio Settings/Keymap "shortcut Ctrl+Alt+S"
search for usage of "Alt + Ent" as below image if its not assigned for any action plz go for No. 2
In the Android studio Settings/Editor/Intentions.
Check whatever you want to show Intention in are checked or not as below photo
Double check no.1 is working fine and you found usage of "Alt + Ent" shortcut
[You can find the solution on official Jet brains website]
Intellij IDEA keyboard shortcuts
Intention actions
I faced the same problem and was sure that the problem is in Android Studio. But when I reinstalled it I realized that it did not helped. So I decided to test my keyboard. I found that my left Alt is not working with Enter and right Alt somewhy is turning on Ctrl key. That is why Alt+Enter was not working in any combinations. Problem was solved by reinstalling keyboard driver. Hope it will helps somebody.
Go to File and Unchecked Power Save mode.
For Windows/Linux, you can go to File -> Settings -> Editor -> General -> Auto Import -> Java and make the following changes:
change Insert imports on paste value to All if ask or none to All
markAdd unambigious imports on the fly option as checked
On a Mac, do the same thing in Android Studio -> Preferences
If someone encounters this issue nowadays, for me it was the language change on the keyboard. I must have made some weird keyboard combination that changed the language, therefore ALT + ENTER was not really doing I was thinking it should do. Switching it back to ENG made it work correctly. Cheers.
in Android Studio 3.2.1, the Alt + Enter combination key is only used on the left side of the keyboard.
If you want to use the Alt to the right, it should be manually selected from the section
Settings> Keymap> other
Right-click on the row
show intention action
select add keyboard shortcut
Press Alt (Right) + Enter
I hope this helps
it was the problem with the latest version to...instead of pressing alt+enter. use ctr+o it will open a dialog box then select the method u want to implement and then click on ok button ..its works with all version of android studio.. { Happy coding ;) }
I thought I had the same issue and none of the above fixed the problem. I thought I was using Alt+Enter for Parameter info. Now I use Ctrl+p I get the parameter info for the widget. Not sure if this was changed from Alt+Enter to Ctrl+p but if looking in the File/Setting/Keymap it shows Ctrl+P.
I just ran into this and what worked is Alt+Insert combination
The first thing you have to check is did you put the code inside the onCreate function?
If not put it there and try again. the Alt+ Enter would work after that.
I encountered the same issue after I upgraded Ubuntu. Left Alt+Enter was working but more comfortable Right Alt+Enter did't. Resolved using this solution in AskUbuntu.
In case if you cannot open the link:
Open "Tweaks" (aka "Gnome Tweaks") go to "Keyboard & Mouse" -> "Additional Layout Options" -> "Key to choose the 3rd level" and put a check mark on "Right Alt never chooses 3rd level".
I faced the same problem. Then I found that I was typing the
public void functionName (View view) outside the class. Hence alt + enter did not work.
After I moved the function inside the class, alt + enter worked.
This is a silly mistake though.
In my case (v4.0.0) there was a plugin (CSV Plugin) blocking the shortcut alt + enter.
Generally speaking, my suggestion is to try deactivating all the plugins and see if then it works.
I just pressed alt + f4 to exit and pressed cancel just to check if alt key was working. Fortunately after that everything was working fine.
Go to 1)setting > 2)intensions > 3)checkmark (Dart) and it will work normally without any problem.

Disable shortcut in Android Studio

I always accidentally do the following keyboard combination SHIFT + ALT + X which will close all of my open files in Android Studio.
UPDATED
My apology, I should have been more clearer asking question. The first thing I did is to google it and I did saw the post in stackoverflow but I can't find SHIFT + ALT + X
See screen shot here:
Go to File -> Settings -> Keymap search for Clear Context and remove or replace the shortcut
Move to File -> Settings -> Keymap and change Keymaps settings to your keymap,for Example : Visual Studio,so that you can use the short cut keys like in Visual Studio.
From here,you can enable or disable any shortcut, you want.
Type in Search, Clear Context.
Then on it Right Click, and you will get your choice.

How to jump to class or method implementation in Android Studio

With Eclipse I would just hover over class or method name and CTRL+? to jump to the implementation. Even if it was an import I was interested in I could jump to the implementation.
In Android Studio, how is this done for methods and classes?
I don't think CTRL+Alt+7 is what I want. I want to go to where the code is written for the type or method defined that the cursor is hovering over or selected.
I've got lots of code to review so I would appreciate an answer for this.
I'm on a PC but I would like to know for Mac as well.
To jump to the implementation - Go with CTRL + YourMethodname OR Scroll-click on method as in Eclipes
Following are used in Android Studio
Add unimplemented methods: CTRL + I
Override methods: CTRL + O
Format code: CTRL + ALT + L
Show project: ALT + 1
Show logcat: ALT + 6
Build: CTRL + F9
Build and Run: CTRL + F10
Expand all: CTRL + SHIFT + NumPad -
Find and replace: CTRL + R
Find: CTRL + F
You can change shortcuts by following below :-
This section lists Android Studio keyboard shortcuts for the
default keymap. To change the default keymap on Windows and Linux, go
to File > Settings > Keymap. If you're using Mac OS X, update your
keymap to use the Mac OS X 10.5+ version keymaps under Android Studio
Preferences > Keymap.
Here is Official documentation for Android studio tips and shortcuts
For Mac: Android Studio Shortcuts for Mac OS
CTRL+Click (=left mouse key) should work, just as in Eclipse!
...to jump to the implementation...
In Android Studio, how is this done for methods and classes?
The keyboard shortcut you are looking for is:
CTRL + B
It could also be done by using the mouse:
Wheel/Middle Click on method / classes
Or by using both the mouse and the keyboard:
CTRL + Left Click on method / classes
On mac you can use this shortkey:
And if you are comforable to eclipse,you can change your keymap to exlipse in here:
I know this is old question but I found the solution for myself.
It is CTRL+ F12 for Method search and its name is File Structure(Main menu -> Navigate -> File Structure) keymap.
For Class search you can use CTRL + N. Its name is Go to Class(Main menu -> Navigate -> Go to Class) in keymap.
You can change their defaults in given paths in Setting -> Keymap.
I am using Flutter for app development.
But I am also using native Android (Kotlin) with flutter for the app development.
So in Android studio, jumping into classes written in Kotlin was not working if I opened the whole flutter project.
So solution is to open only android folder in the Android studio, instead of whole project where flutter files (lib folder) is also present.
Then I was able to use cmd + mouse (or ctrl + mouse for Windows) to jump into the Kotlin classes.

How do I align/format code in Android Studio?

Is there a way/shortcut/built-in feature that can align code for operands, like '=' signs?
For example, there is a XAlign for Xcode (https://github.com/qfish/XAlign), allowing the user to select code that needs to be aligned and use a shortcut to align it automatically.
There is a Fields Group feature in Android Studio which can "Align in columns", but it does not work for code that is already written.
Indent code in Android Studio:
Windows
Ctrl + Alt + L
Mac:
Option + Command + L
The alignment for variable declarations works for only those that are outside of functions. The alignment feature in menu Preference → Code Style → Wrapping and Braces → Fields Groups → "Align in Columns" does not work for those inside the brackets/braces.
Here is an issue ticket on the JetBrains website: https://youtrack.jetbrains.com/issue/IDEA-56947#
This feature is available, but not in the stable release yet. It is available from build: 140.1761
At the time of writing this answer my current build is "135.1653844, built on December 18, 2014" on Stable Release.
In Eclipse which comes with Android Studio Bundle, the shortcut key is as follows to initiate Auto Formatter:
Ctrl + alt + L
If you want to change this combination, go to menu Preferences → Keymap and set to custom.
Windows:
Ctrl+Alt+L
Linux:
Ctrl+Shift+Alt+L
macOS:
⌥ option+⌘ command+L
For Windows and Linux in Android Studio:
Ctrl + Alt + L
For Mac:
Option + Command + L
Ubuntu Linux: Ctrl-alt-L (suggested by other responses) is captured by the window manager and locks the screen. So you need to change it: file->settings->keymap->main menu->code->Reformat Code. I use a double tab since I don't want the tab to shift a selection right.
This formats the code as you've specified in your preferences. To handle your specific request (aligning equals statements) go to: (file->settings->editor->code style->(choose language)->Wrapping and braces->Group declarations->align variables in columns
These styles are language specific so this particular option might not exist in the language you chose, or may be named differently.

Strange key mapping in Android Studio

I am new to Android studio, it seems to be great IDE. But I have found that it has really strange key and shortcut mapping. I am using Czech keyboard.
When I try to type ">" by pressing Right ALT + . the symbol is not appearing, and I got message box that says "Go to custom Region. There are no custom foldings regions in the current file."
It is really strange behaviour, I have problem with writing many more characters like brackets,..... I tried to set keymap profiles to Visual Studio and more. But nothing seems to work. I didn't have any of these problems in any other IDE (Netbeans, Eclipse, Visual Studio, Xamarin)
Add this line:
actionSystem.force.alt.gr=true
to this file:
...\Android\android-studio\bin\idea.properties
As written here:
http://youtrack.jetbrains.com/issue/IDEA-91975
Yes, well... its problem with "old" keyboards. Newer keyboards don't have Alt Gr keys and IDE doesn't count on this in default.
Solutions:
Buy a new keyboard with no Alt Gr on it (using right Alt instead of Alt Gr is working for me)
Go to File -> Settings -> Keymap and search for implementation - delete Ctrl + Alt + B, hit "Apply" and you can now use this shortcut for "{"
As already mentioned below... add following line to ..\<Android Studio folder>\bin\idea.properties:
actionSystem.force.alt.gr=true
(update) Since newer version of AS (not sure which one, should be 2.3.3+), you don't need to manually access the properties file. Go to Help -> Edit Custom Properties and add actionSystem.force.alt.gr=true there.
Go to Preferences -> Keymap and choose Mac OS X as Keymaps.
I have been a long time Visual Studio user, so wanted to leverage all the keyboard shortcuts that I had picked up using Visual Studio.
On Android Studio, I first changed the Keymap to be Visual Studio. You can do this by using Alt+F7 on Windows and then search for Keymap.
By using the Visual Studio Keymap in Android studio, I got only debug related mapping, which was still a minority of what I use in Visual Studio.
So went ahead and added/modified some more mappings.
Here is the github link
https://github.com/vinayakg/VisualStudioKeymapforAndroidStudio/blob/master/settings.jar.
PR's welcome.
As for '>' sign (AltGr + .) and Android Studio 1.0.1, go to File>Settings, choose Keymap in IDE Settings section, search for "GotoCustomRegion" item (it is located in MainMenu-Navigate) and remove its mapping (via context menu).
If you're using macOS newest versions and have had weird behavior with the shortcuts, try this:
Go to Android Studio -> Preferences -> Keymap
Now change from "Mac OS X" to "Mac OS X 10.5+" and hit apply.

Resources