简体   繁体   中英

Android-Studio Flutter Code formatting problem

What is my problem, that my dartcode is missing these helping //{Widget} comments.

My problem is, I think, not very difficult to solve, but I have problems describing it. In my freshly installed version of Android Studio (with dart and flutter plugin), when I close a widget, it is no longer shown in two brackets which widget it is. Not a huge problem, but it does limit the clarity of the code. I didn't change any of the settings. Maybe it is related to the operating system (I use Linux(PopOS 19.04)).

at my place:
class ExampleState extends State<NoteList> {
  @override
  Widget build(BuildContext context) {
    return Scaffold (
    appBar: AppBar(
        title: Text('Example'),
      ),
    );
  }
}

my goal:

class ExampleState extends State<NoteList> {
  @override
  Widget build(BuildContext context) {
    return Scaffold (
    appBar: AppBar(
        title: Text('Example'),
      ), //AppBar
    ); //Scaffold
  }
}


I hope someone can help me.

So I think this was a change in the latest updates of the Android Studio, but in order to get it back go to:

Android Studio -> Preferences -> Editor -> General -> Appearance

Enable the Show closing labels in Dart Source code .

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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