flutter / flutter/flutter-intellij

Weird behavior of reformatting in Android Studio

Open
#4,713 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
356
Avg merge
1d 11h
Merged PRs (30d)
27

Description

Weird behavior of reformatting:
![Screen-Recording-2020-07-22-at-1](https://user-images.githubusercontent.com/14845825/88132258-98e6e300-cc11-11ea-904c-697ad3bf9ea8.gif)

## Steps to Reproduce

``` dart
import 'package:flutter/material.dart';

class ChapterCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
child: Card(
child: AspectRatio(
aspectRatio: 2.0,
child: Image.network("https://wallpaperplay.com/walls/full/f/f/6/200727.jpg"),
)
)
);
}
}
```
Copy & paste the code above in the Android Studio editor and run `Reformat Code` action (`Option + Cmd + L` on Mac).

## Version info
```
[✓] Flutter (Channel master, 1.21.0-2.0.pre.94, on Mac OS X 10.15.6 19G73, locale en-CN)
• Flutter version 1.21.0-2.0.pre.94 at /Users/luffy/Flutter/flutter
• Framework revision adc9dde3ba (4 hours ago), 2020-07-21 16:17:23 -0700
• Engine revision 5a73d4dc25
• Dart version 2.9.0 (build 2.9.0-21.0.dev 84e5eeaea4)


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/luffy/Library/Android/sdk
• Platform android-29, build-tools 29.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_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[!] IntelliJ IDEA Community Edition (version 2020.1.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.46.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.