最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

flutter - Why does VSCode offer widget properties that don't exist? - Stack Overflow

programmeradmin0浏览0评论

It so happens that I started my acquaintance with IDEs with Eclipse, NetBeans, Android Studio. And now I got to Visual Studio Code. A good IDE is supposed to offer only those properties that belong to a given class. Is it normal behavior that in the following code snippet VSCode offers a width property for ElevatedButton?

SizedBox(
  height: 50,
  width: 250,
  child: ElevatedButton(
      style: ElevatedButton.styleFrom(
        backgroundColor: Colors.deepPurple.withAlpha(400),
        shape: kRBorderShape,
      ),
      child: const Text('Barcode Scanner'),
      onPressed: () {}
  ),
),

It so happens that I started my acquaintance with IDEs with Eclipse, NetBeans, Android Studio. And now I got to Visual Studio Code. A good IDE is supposed to offer only those properties that belong to a given class. Is it normal behavior that in the following code snippet VSCode offers a width property for ElevatedButton?

SizedBox(
  height: 50,
  width: 250,
  child: ElevatedButton(
      style: ElevatedButton.styleFrom(
        backgroundColor: Colors.deepPurple.withAlpha(400),
        shape: kRBorderShape,
      ),
      child: const Text('Barcode Scanner'),
      onPressed: () {}
  ),
),

Share Improve this question edited Feb 2 at 7:14 rozerro asked Feb 2 at 7:07 rozerrorozerro 7,21614 gold badges64 silver badges117 bronze badges 5
  • 1 code.visualstudio/docs/editor/… the abc icon suggests this is a simple word completion not any specific property or method completion. Its acting as a simple autocomplete and not offering any specific properties – Suraj Rao Commented Feb 2 at 7:37
  • @SurajRao then why doesn't it use property or method completion? Is it customizable? – rozerro Commented Feb 2 at 7:51
  • 1 It should provide the suggestions provided you have the dart and flutter extensions installed and nothing is disabled in settings.json – Suraj Rao Commented Feb 2 at 8:05
  • 1 @SurajRao Indeed, clearing the settings.json file solved the problem – rozerro Commented Feb 2 at 10:12
  • your question is probably really "why does the flutter extension I'm using only ..." – starball Commented Feb 3 at 1:58
Add a comment  | 

1 Answer 1

Reset to default 0

You can check the differance between two images, The shape of the following suggestion is different from abc, abc is not property.

发布评论

评论列表(0)

  1. 暂无评论