{"id":191105,"date":"2022-09-07T15:29:45","date_gmt":"2022-09-07T07:29:45","guid":{"rendered":"https:\/\/www.idc.net\/help\/191105\/"},"modified":"2022-09-07T15:29:45","modified_gmt":"2022-09-07T07:29:45","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91flutter%e6%95%99%e7%a8%8b%ef%bc%9aflutter-%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/191105\/","title":{"rendered":"\u540e\u6d6a\u4e91Flutter\u6559\u7a0b\uff1aFlutter \u683c\u5f0f\u5316\u4ee3\u7801"},"content":{"rendered":"<h2>\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801<\/h2>\n<p>\u5c3d\u7ba1\u60a8\u53ef\u4ee5\u6309\u7167\u4efb\u4f55\u559c\u6b22\u7684\u6837\u5f0f - \u4f46\u6839\u636e\u6211\u4eec\u7684\u7ecf\u9a8c \uff0c\u4e00\u4e2a\u5f00\u53d1\u56e2\u961f\u4f1a\uff1a<\/p>\n<ol>\n<li>\u6709\u4e00\u4e2a\u5355\u4e00\u7684\u3001\u5171\u4eab\u7684\u6837\u5f0f<\/li>\n<li>\u901a\u8fc7\u81ea\u52a8\u683c\u5f0f\u5316\u6765\u5f3a\u5236\u6267\u884c\u6b64\u6837\u5f0f.<\/li>\n<\/ol>\n<h3>\u5728Android Studio\u548cIntelliJ\u4e2d\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801<\/h3>\n<p>\u5b89\u88c5Dart\u63d2\u4ef6\uff08\u8bf7\u53c2\u9605\u7f16\u8f91\u5668\u8bbe\u7f6e\uff09\uff0c\u4ee5\u4fbf\u5728Android Studio\u548cIntelliJ\u4e2d\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801\u3002<\/p>\n<p>\u8981\u5728\u5f53\u524d\u6e90\u4ee3\u7801\u7a97\u53e3\u4e2d\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801\uff0c\u8bf7\u53f3\u952e\u5355\u51fb\u4ee3\u7801\u7a97\u53e3\u5e76\u9009\u62e9Reformat code with dartfmt\u3002\u60a8\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5feb\u6377\u952e\u6765\u683c\u5f0f\u5316\u4ee3\u7801\u3002<\/p>\n<h3>\u81ea\u52a8\u683c\u5f0f\u5316VS Code\u4e2d\u7684\u4ee3\u7801<\/h3>\n<p>\u5b89\u88c5Dart-Code\u63d2\u4ef6\uff08\u8bf7\u53c2\u9605\u7f16\u8f91\u5668\u8bbe\u7f6e\uff09\u4ee5\u5728VS Code\u4e2d\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801\u3002<\/p>\n<p>\u8981\u5728\u5f53\u524d\u6e90\u4ee3\u7801\u7a97\u53e3\u4e2d\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801\uff0c\u8bf7\u53f3\u952e\u5355\u51fb\u4ee3\u7801\u7a97\u53e3\u5e76\u9009\u62e9Format Document\u3002\u60a8\u4e5f\u53ef\u4ee5\u901a\u8fc7VS Code\u7684\u5feb\u6377\u952e\u6765\u683c\u5f0f\u5316\u4ee3\u7801\u3002<\/p>\n<p>\u8981\u5728\u4fdd\u5b58\u6587\u4ef6\u65f6\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801\uff0c\u8bf7\u5c06editor.formatOnSave\u8bbe\u7f6e\u8bbe\u7f6e\u4e3atrue\u3002<\/p>\n<h3>\u4f7f\u7528flutter\u547d\u4ee4\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801<\/h3>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0bflutter format\u547d\u4ee4\u5728\u547d\u4ee4\u884c\u754c\u9762\uff08CLI\uff09\u4e2d\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801\uff1a<\/p>\n<pre><code>Usage: flutter format &lt;one or more paths&gt;\n-h, --help    Print this usage information.\n<\/code><\/pre>\n<h3>\u4f7f\u7528 \u2018\u5c3e\u968f\u9017\u53f7\u2019<\/h3>\n<p>Flutter\u4ee3\u7801\u901a\u5e38\u6d89\u53ca\u6784\u5efa\u76f8\u5f53\u6df1\u7684\u6811\u72b6\u6570\u636e\u7ed3\u6784\uff0c\u4f8b\u5982\u5728\u4e00\u4e2abuild\u65b9\u6cd5\u4e2d\u3002 \u4e3a\u4e86\u83b7\u5f97\u826f\u597d\u7684\u81ea\u52a8\u683c\u5f0f\u5316\uff0c\u6211\u4eec\u5efa\u8bae\u60a8\u91c7\u7528\u53ef\u9009\u7684\u5c3e\u90e8\u9017\u53f7\u3002\u6dfb\u52a0\u5c3e\u968f\u9017\u53f7\u5f88\u7b80\u5355\uff1a\u59cb\u7ec8\u5728\u51fd\u6570\u3001\u65b9\u6cd5\u548c\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u5217\u8868\u672b\u5c3e\u6dfb\u52a0\u5c3e\u968f\u9017\u53f7\uff0c\u4ee5\u4fbf\u4fdd\u7559\u60a8\u7684\u7f16\u7801\u683c\u5f0f\u3002 \u8fd9\u5c06\u6709\u52a9\u4e8e\u81ea\u52a8\u683c\u5f0f\u5316\u7a0b\u5e8f\u4e3aFlutter\u6837\u5f0f\u4ee3\u7801\u63d2\u5165\u9002\u5f53\u7684\u6362\u884c\u7b26\u3002<\/p>\n<p>\u8fd9\u91cc\u662f\u4e00\u4e2a\u81ea\u52a8\u683c\u5f0f\u5316\u516c\u5f0f\u683c\u5f0f\u5316\u5e26\u6709\u5c3e\u90e8\u9017\u53f7\u4ee3\u7801\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u5c3e\u90e8\u9017\u53f7\uff0c\u683c\u5f0f\u5316\u540e\u5219\u4f1a\u662f\u4e0b\u9762\u8fd9\u6837\uff1a<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u81ea\u52a8\u683c\u5f0f\u5316\u4ee3\u7801 \u5c3d\u7ba1\u60a8\u53ef\u4ee5\u6309\u7167\u4efb\u4f55\u559c\u6b22\u7684\u6837\u5f0f - \u4f46\u6839\u636e\u6211\u4eec\u7684\u7ecf\u9a8c \uff0c\u4e00\u4e2a\u5f00\u53d1\u56e2\u961f\u4f1a\uff1a \u6709\u4e00\u4e2a\u5355\u4e00\u7684\u3001\u5171\u4eab\u7684\u6837 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":191106,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182398],"tags":[],"class_list":["post-191105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mini-program"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/191105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=191105"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/191105\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/191106"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=191105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=191105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=191105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}