Fluent quick development of MAC Android studio

Time:2021-8-11

Fluent quick development of MAC Android studio

Lao Meng Guide: this shortcut is applicable to Android studio under Mac. For shortcuts under windows, please refer to this article:https://juejin.im/post/5efe71365188252e7d7fd0ca

Quickly create a new stateless or stateful component

Create a new stateless component, enter stless, and press enter:

Fluent quick development of MAC Android studio

Create a new stateful component, enter stful, and press enter:

Fluent quick development of MAC Android studio

Create a new animation component, enter stanim, and press enter:

Fluent quick development of MAC Android studio

There are other shortcuts, which are not introduced here. These shortcuts arePreferencesCan be found in: preferences – > editor – > Live Templates:

Fluent quick development of MAC Android studio

Dart and fluent are shortcuts that can also be modified. My shortcuts above are directly imported into packages and comments, which are added by myself. They are not available by default:

Fluent quick development of MAC Android studio

Customize the shortcut key, select fluent, and click the shortcut key in the upper right corner+No., select live template, then enter the name and generated code, and clickOK

Fluent quick development of MAC Android studio

A warning will appear at the bottom. Select dart and click OK.

Fluent quick development of MAC Android studio

The method used is the same. Enter test and press enter.

File And Code Templates

When creating a dart file, the default code is generated. Open preferences – > editor – > file and code templates, and select the Files tab on the right. By default, it is empty

Fluent quick development of MAC Android studio

Add auto generated code:

import 'package:flutter/material.dart';

///
/// des:
///
class ${NAME} extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

Fluent quick development of MAC Android studio

Create a home_ Dart file for page:

Fluent quick development of MAC Android studio

The newly created dart file automatically generates the preset code.

formatting code

Shortcut key: option + Command + L (letter L key)

Fluent quick development of MAC Android studio

Clear useless references

Shortcut key: control + option + O (letter O key)

Fluent quick development of MAC Android studio

Forward / backward cursor position

When tracking code, you often jump to other classes. The back shortcut: option + Command + left button in the direction, and the forward shortcut: option + Command + right button in the direction,

Fluent quick development of MAC Android studio

View the inheritance relationship of the current class

Shortcut keys: control + H

Fluent quick development of MAC Android studio

Note: it is invalid to select the container in build and press the shortcut key. You must enter the container source code and select the container class name.

notes

Single line comment: Command + /.

Multiline comment / * * /: option + Command + / or select multiline: Command +/

Fluent quick development of MAC Android studio

Find reference

Select the class or method to find, press the shortcut key: Command + G, and a reference list will pop up at the bottom.

Fluent quick development of MAC Android studio

Auto import package

Shortcut key: option + enter, select the correct package.

Fluent quick development of MAC Android studio

Automatic positioning

When a code file is entered on the right side, the left side will be customized to this file, and check autoscroll to source and autoscroll from source in the project tab settings.

Fluent quick development of MAC Android studio

Note that the project tag on the left changes.

Fluent quick development of MAC Android studio

Current file search

Shortcut key: Command + F

Fluent quick development of MAC Android studio

global search

Shortcut keys: Command + Shift + F

Fluent quick development of MAC Android studio

Search for files:

Shortcut key: click shift twice

Fluent quick development of MAC Android studio

Auto generate constructor:

Select the final parameter and press the shortcut key: option + enter

Fluent quick development of MAC Android studio

Add parent component, change to child component, delete child component

Shortcut key: option + ENTER

Fluent quick development of MAC Android studio

You can add to the current componentCenterPaddingColumnWait for the parent component.

You can also select components to delete or move components.

View UI outline

openFlutter Outlinelabel

Fluent quick development of MAC Android studio

You can clearly see the UI structure.

Extract code into method

openFlutter OutlineTab, click the icon of the right arrow:

Fluent quick development of MAC Android studio

Flutter resources website

  1. Official website:https://flutter.dev/
  2. Chinese website:https://flutterchina.club/
  3. Fluent Chinese community resources:https://flutter-io.cn/
  4. Pub (domestic):https://pub.flutter-io.cn/
  5. pub:https://pub.dev/
  6. DartPad:https://dartpad.dartlang.org/
  7. Dart official website:https://dart.dev/
  8. CodePen:https://codepen.io/
  9. JSON to entity class:https://javiercbk.github.io/json_to_dart/

Finally, I would like to recommend my blog:http://laomengit.com/flutter/widgets/widgets_structure.html, including 330 detailed usage of components and a series of practical articles on fluent.

communication

Laomeng fluent blog address (330 controls usage):http://laomengit.com

Welcome to Flutter exchange group (WeChat: laomengit) and official account [Lao Meng Flutter]:

Fluent quick development of MAC Android studio Fluent quick development of MAC Android studio