{"id":134,"date":"2018-07-06T14:35:06","date_gmt":"2018-07-06T06:35:06","guid":{"rendered":"https:\/\/fick707.com\/?p=134"},"modified":"2018-07-06T14:35:06","modified_gmt":"2018-07-06T06:35:06","slug":"helloflutter","status":"publish","type":"post","link":"https:\/\/fick707.com\/?p=134","title":{"rendered":"Hello,Flutter"},"content":{"rendered":"<div>\n<div>\n<h2>\u4ec0\u4e48\u662fFlutter<\/h2>\n<p>2018\u5e742\u670827\u65e5\uff0c\u57282018\u4e16\u754c\u79fb\u52a8\u5927\u4f1a\u4e0a\uff0cGoogle\u53d1\u5e03\u4e86Flutter\u7684\u7b2c\u4e00\u4e2aBeta\u7248\u672c\u3002Flutter\u662fGoogle\u7528\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u5728Ios\u548cAndroid\u4e24\u4e2a\u5e73\u53f0\u5f00\u53d1\u9ad8\u8d28\u91cf\u539f\u751f\u5e94\u7528\u7684\u5168\u65b0\u79fb\u52a8UI\u6846\u67b6\uff0c<a href=\"https:\/\/link.jianshu.com?t=http%3A%2F%2Fv.youku.com%2Fv_show%2Fid_XMzQyNTE1NDMxMg%3D%3D.html\" target=\"_blank\" rel=\"nofollow noopener\">\u70b9\u51fb\u67e5\u770bFlutter\u4ecb\u7ecd\u89c6\u9891<\/a>\u3002<\/p>\n<p>\u5176\u5b9e\u6211\u7b2c\u4e00\u6b21\u542c\u8bf4Flutter\u662f\u5728\u6536\u5230\u8c37\u6b4c\u5f00\u53d1\u8005\u516c\u4f17\u53f7\u7684\u63a8\u9001\u91cc\uff0c\u5f53\u65f6\u8bfb\u5b8c\u4e86\u90a3\u7bc7\u6587\u7ae0\u89c9\u5f97Flutter\u7684\u4f18\u70b9\u786e\u5b9e\u6bd4\u8f83\u7a81\u51fa\uff1a<\/p>\n<ol>\n<li>\u70ed\u91cd\u8f7d\uff08Hot Reload\uff09\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u83dc\u9e1f\u5b89\u5353\u5f00\u53d1\u8005\uff0c\u80fd\u70ed\u91cd\u8f7d\u771f\u7684\u592a\u8212\u670d\u4e86\uff0c\u5229\u7528Android Studio\u76f4\u63a5\u4e00\u4e2actrl+s\u5c31\u53ef\u4ee5\u4fdd\u5b58\u5e76\u91cd\u8f7d\uff0c\u6a21\u62df\u5668\u7acb\u9a6c\u5c31\u53ef\u4ee5\u770b\u89c1\u6548\u679c\uff0c\u5c31\u8fd9\u4e00\u70b9\u6bd4\u539f\u751f\u5b89\u5353\u5236\u4f5c\u7b80\u76f4\u4e0d\u77e5\u9053\u9ad8\u5230\u54ea\u91cc\u53bb\u4e86\u3002<\/li>\n<li>\u4e00\u5207\u7686\u4e3aWidget\u7684\u7406\u5ff5\uff0c\u5bf9\u4e8eFlutter\u6765\u8bf4\uff0c\u624b\u673a\u5e94\u7528\u91cc\u7684\u6240\u6709\u4e1c\u897f\u90fd\u662fWidget\uff0c\u901a\u8fc7\u53ef\u7ec4\u5408\u7684\u7a7a\u95f4\u96c6\u5408\u3001\u4e30\u5bcc\u7684\u52a8\u753b\u5e93\u4ee5\u53ca\u5206\u5c42\u8bfe\u6269\u5c55\u7684\u67b6\u6784\u5b9e\u73b0\u4e86\u5bcc\u6709\u611f\u67d3\u529b\u7684\u7075\u6d3b\u754c\u9762\u8bbe\u8ba1\u3002<\/li>\n<li>\u501f\u52a9\u53ef\u79fb\u690d\u7684GPU\u52a0\u901f\u7684\u6e32\u67d3\u5f15\u64ce\u4ee5\u53ca\u9ad8\u6027\u80fd\u672c\u5730\u4ee3\u7801\u8fd0\u884c\u65f6\u4ee5\u8fbe\u5230\u8de8\u5e73\u53f0\u8bbe\u5907\u7684\u9ad8\u8d28\u91cf\u7528\u6237\u4f53\u9a8c\u3002 \u8fd9\u6bb5\u4ecb\u7ecd\u662f\u76f4\u63a5\u6284\u4e0b\u6765\u7684\uff0c\u867d\u7136\u6211\u5e76\u4e0d\u77e5\u9053\u4ec0\u4e48\u53eb\u53ef\u79fb\u690d\u7684GPU\u52a0\u901f\u7684\u6e32\u67d3\u5f15\u64ce\uff0c\u4f46\u662f\u6700\u7ec8\u7ed3\u679c\u5c31\u662f\u5229\u7528Flutter\u6784\u5efa\u7684\u5e94\u7528\u5728\u8fd0\u884c\u6548\u7387\u4e0a\u4f1a\u548c\u539f\u751f\u5e94\u7528\u5dee\u4e0d\u591a\u3002<br \/>\n\u9177\u5b89\u4e0a\u6709\u4e00\u4e2aFlutter\u7684\u6f14\u793aDemo\uff0c<a href=\"https:\/\/link.jianshu.com?t=https%3A%2F%2Fwww.coolapk.com%2Fapk%2Fio.flutter.gallery\" target=\"_blank\" rel=\"nofollow noopener\">Flutter Gallery<\/a>\u3002<br \/>\n\u5982\u679c\u7ecf\u5e38\u901b\u9177\u5b89\u7684\u4e00\u5b9a\u4f1a\u53d1\u73b0\u8fd9\u4e2a\u753b\u5eca\u7684\u6f14\u793aDemo\u7684\u56fe\u6807\u548c\u53e6\u4e00\u4e2a\u6f14\u793aDemo\u7684\u56fe\u6807\u662f\u4e00\u6837\u7684\uff0c<a href=\"https:\/\/link.jianshu.com?t=https%3A%2F%2Fwww.coolapk.com%2Fapk%2Fcom.google.fuchsia.armadillo\" target=\"_blank\" rel=\"nofollow noopener\">Google Fuchsia OS Preview<\/a>,\u8fd9\u4e2a\u5e94\u7528\u7684\u662f\u4f20\u95fb\u7684Google\u6b63\u5728\u7814\u53d1\u7684\u65b0\u4e00\u4ee3\u64cd\u4f5c\u7cfb\u7edf\uff0c\u6240\u4ee5\u4e2a\u4eba\u8ba4\u4e3a\uff0cFlutter\u7684\u5b58\u5728\u53ef\u80fd\u4e0d\u4ec5\u4ec5\u662f\u5b9e\u73b0\u5728\u5b89\u5353\u548cIOS\u4e0a\u7684\u8fd0\u884c\uff0c\u66f4\u662f\u4e3a\u4e86\u65e5\u540e\u4e30\u5bccFuchsia\u8fd9\u4e2a\u65b0\u7cfb\u7edf\u7684\u8f6f\u4ef6\u751f\u6001\u800c\u5b58\u5728\u7684\u3002<\/li>\n<\/ol>\n<h2>Flutter\u7684\u6838\u5fc3\u5185\u5bb9<\/h2>\n<p>\u63a5\u4e0b\u6765\u6211\u60f3\u5199\u4e00\u4e0b\u6211\u81ea\u5df1\u901a\u8fc7\u8fd9\u4e24\u5929\u7684\u63a5\u89e6\u5bf9\u4e8eFlutter\u7684\u6838\u5fc3\u5185\u5bb9\u4e5f\u5c31\u662f\u4e0a\u9762\u597d\u5904\u7684\u7b2c\u4e8c\u70b9\u7684\u7406\u89e3\u3002<\/p>\n<h4>\u4e00\u5207\u90fd\u662f\u63a7\u4ef6\uff08Widget\uff09<\/h4>\n<p>\u5728Flutter\u4e2d\uff0c\u6bcf\u4e2a\u5e94\u7528\u7a0b\u5e8f\u90fd\u662fWidget\uff0c\u8fd9\u70b9\u548c\u5176\u4ed6\u7684\u5e94\u7528\u6846\u67b6\u4e0d\u4e00\u6837\uff0cFlutter\u7684\u5bf9\u8c61\u6a21\u578b\u662f\u7edf\u4e00\u7684\uff0c\u4e5f\u5c31\u662f\u63a7\u4ef6\u3002<br \/>\n\u4e00\u4e2a\u63a7\u4ef6\u53ef\u4ee5\u5b9a\u4e49\uff1a<\/p>\n<ul>\n<li>\u7ed3\u6784\u5143\u7d20\uff08\u6bd4\u5982\u6309\u94ae\u6216\u8005\u83dc\u5355\uff09<\/li>\n<li>\u98ce\u683c\u5143\u7d20\uff08\u6bd4\u5982\u5b57\u4f53\u6216\u8005\u989c\u8272\u65b9\u6848\uff09<\/li>\n<li>\u5e03\u5c40<\/li>\n<li>\u4e00\u4e9b\u4e1a\u52a1\u903b\u8f91<\/li>\n<li>\u7b49\u7b49\u3002\u3002\u3002\u3002<br \/>\n\u63a7\u4ef6\u662f\u57fa\u4e8e\u6784\u56fe\u5f62\u6210\u5c42\u6b21\u7ed3\u6784\uff0c\u6bcf\u4e2a\u63a7\u4ef6\u5d4c\u5957\u5728\u5176\u4e2d\uff0c\u5e76\u4ece\u5176\u7236\u4ee3\u7ee7\u627f\u5c5e\u6027\uff0c\u6ca1\u6709\u5355\u72ec\u7684\u201c\u5e94\u7528\u7a0b\u5e8f\u201d\u5bf9\u8c61\uff0c\u53ea\u6709\u6839\u63a7\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u544a\u77e5\u6846\u67b6\u7528\u53e6\u4e00\u4e2a\u63a7\u4ef6\u66ff\u6362\u5c42\u6b21\u7ed3\u6784\u4e2d\u7684\u63a7\u4ef6\u6765\u54cd\u5e94\u4e8b\u4ef6\uff0c\u6bd4\u5982\u7528\u6237\u4ea4\u4e92\uff0c\u7136\u540e\u6846\u67b6\u4f1a\u5bf9\u6bd4\u65b0\u7684\u63a7\u4ef6\u548c\u65e7\u7684\u63a7\u4ef6\uff0c\u5e76\u6709\u6548\u7684\u66f4\u65b0\u7528\u6237\u754c\u9762\uff0c\u5373\u66f4\u65b0\u6709\u53d8\u5316\u7684\u63a7\u4ef6\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728Flutter\u4e2d\uff0c\u4e00\u4e2a\u5e94\u7528\u5c31\u662f\u6709\u8bb8\u8bb8\u591a\u591a\u7684Widget\u7ec4\u5408\u800c\u6210\u7684\u3002<\/p>\n<h2>\u6784\u5efa\u7b2c\u4e00\u4e2aFlutter\u5b9e\u4f8b<\/h2>\n<p>\u5148\u6765\u4ecb\u7ecd\u4e00\u4e0bFlutter\u91cc\u9762\u7684\u57fa\u672c\u7a7a\u95f4\uff1a<\/p>\n<ul>\n<li>Text\uff1a\u6587\u672c\u63a7\u4ef6\uff0c\u5728\u5e94\u7528\u4e2d\u521b\u5efa\u5404\u79cd\u6837\u5f0f\u7684\u6587\u672c\u3002<\/li>\n<li>Row,Column\uff1aFlex\u63a7\u4ef6\uff0c\u53ef\u4ee5\u521b\u5efa\u6c34\u5e73(Row)\u6216\u5782\u76f4(Column)\u65b9\u5411\u7684\u5e03\u5c40\uff0c\u662f\u57fa\u4e8eWeb\u7684flexbox\u7684\u5e03\u5c40\u6a21\u5f0f\u8bbe\u8ba1\u7684\u3002<\/li>\n<li>Stack\uff1a\u975e\u7ebf\u6027\u5e03\u5c40\uff08\u6c34\u5e73\u6216\u5782\u76f4\uff09\uff0c\u63a7\u4ef6\u53ef\u4ee5\u5806\u53e0\u5728\u5176\u4ed6\u63a7\u4ef6\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528Positioned\u63a7\u4ef6\u63a7\u5236Stack\u76f8\u5bf9\u9876\u90e8\u3001\u53f3\u90e8\u3001\u5e95\u90e8\u548c\u5de6\u90e8\u7684\u4f4d\u7f6e\uff0c\u662f\u57fa\u4e8eWeb\u7684absolute\u5b9a\u4f4d\u7684\u5e03\u5c40\u6a21\u5f0f\u3002<\/li>\n<li>Container\uff1a\u521b\u5efa\u77e9\u5f62\u7684\u53ef\u89c6\u5143\u7d20\uff0c\u53ef\u4ee5\u7528BoxDecoration\u6765\u8bbe\u8ba1\u6837\u5f0f\uff0c\u6bd4\u5982\u80cc\u666f\u3001\u8fb9\u6846\u548c\u9634\u5f71\uff0cContainer\u4e5f\u6709\u8fb9\u8ddd\u3001\u586b\u5145\u548c\u5927\u5c0f\u9650\u5236\uff0c\u53e6\u5916\uff0c\u8fd8\u53ef\u4ee5\u5728\u4e09\u7ef4\u7a7a\u95f4\u5229\u7528\u77e9\u9635\u8fdb\u884c\u53d8\u6362\u3002<\/li>\n<\/ul>\n<p>\u7ed3\u5408\u5b9e\u4f8b\u5206\u6790\uff1a<\/p>\n<pre class=\"hljs java\"><code class=\"java\"><span class=\"hljs-keyword\">import<\/span> <span class=\"hljs-string\">'package:flutter\/material.dart'<\/span>;\r\n\r\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MyAppBar<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title\">StatelessWidget<\/span> <\/span>{\r\n  MyAppBar({<span class=\"hljs-keyword\">this<\/span>.title});\r\n\r\n  <span class=\"hljs-keyword\">final<\/span> Widget title;\r\n\r\n  <span class=\"hljs-meta\">@override<\/span>\r\n  <span class=\"hljs-function\">Widget <span class=\"hljs-title\">build<\/span><span class=\"hljs-params\">(BuildContext context)<\/span> <\/span>{\r\n    <span class=\"hljs-comment\">\/\/ <span class=\"hljs-doctag\">TODO:<\/span> implement build<\/span>\r\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">new<\/span> Container(\r\n      height: <span class=\"hljs-number\">56.0<\/span>,\r\n      padding: <span class=\"hljs-keyword\">const<\/span> EdgeInsets.symmetric(horizontal: <span class=\"hljs-number\">8.0<\/span>),\r\n      decoration: <span class=\"hljs-keyword\">new<\/span> BoxDecoration(color: Colors.blue[<span class=\"hljs-number\">500<\/span>]),\r\n      <span class=\"hljs-comment\">\/\/new Row\u610f\u5473\u7740\u8be5\u5b50\u5e03\u5c40\u4e3a\u6c34\u5e73\u5e03\u5c40<\/span>\r\n      child: <span class=\"hljs-keyword\">new<\/span> Row(\r\n        children: &lt;Widget&gt;[\r\n          <span class=\"hljs-comment\">\/\/\u5e03\u5c40\u4f9d\u6b21\u4e3a\u56fe\u6807\u6309\u94ae\uff0c\u5269\u4f59\u5bb9\u5668\u548c\u56fe\u6807\u6309\u94ae\uff0c\u5982\u679c\u628a\u7b2c\u4e8c\u4e2aIconButton\u79fb\u52a8\u5230Expanded\u524d\u5219\u5185\u5bb9\u4f1a\u53d1\u751f\u6539\u53d8<\/span>\r\n          <span class=\"hljs-keyword\">new<\/span> IconButton(\r\n              icon: <span class=\"hljs-keyword\">new<\/span> Icon(Icons.menu),\r\n              tooltip: <span class=\"hljs-string\">'\u5bfc\u822a\u83dc\u5355'<\/span>,\r\n              onPressed: <span class=\"hljs-keyword\">null<\/span>\r\n          ),\r\n          <span class=\"hljs-comment\">\/\/Expanded\u7684\u4f5c\u7528\u53ef\u4ee5\u4f7f\u7528\u5269\u4f59\u7684\u6240\u6709\u7a7a\u95f4\u3002<\/span>\r\n          <span class=\"hljs-keyword\">new<\/span> Expanded(\r\n              child: title\r\n          ),\r\n          <span class=\"hljs-keyword\">new<\/span> IconButton(\r\n              icon: <span class=\"hljs-keyword\">new<\/span> Icon(Icons.search),\r\n              tooltip: <span class=\"hljs-string\">'\u641c\u7d22'<\/span>,\r\n              onPressed: <span class=\"hljs-keyword\">null<\/span>\r\n          )\r\n        ],\r\n      ),\r\n    );\r\n  }\r\n}\r\n\r\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MyScaffold<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title\">StatelessWidget<\/span> <\/span>{\r\n  <span class=\"hljs-meta\">@override<\/span>\r\n  <span class=\"hljs-function\">Widget <span class=\"hljs-title\">build<\/span><span class=\"hljs-params\">(BuildContext context)<\/span> <\/span>{\r\n    <span class=\"hljs-comment\">\/\/ <span class=\"hljs-doctag\">TODO:<\/span> implement build<\/span>\r\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">new<\/span> Material(\r\n      child: <span class=\"hljs-keyword\">new<\/span> Column(\r\n        children: &lt;Widget&gt;[\r\n          <span class=\"hljs-keyword\">new<\/span> MyAppBar(\r\n            title: <span class=\"hljs-keyword\">new<\/span> Text(\r\n              <span class=\"hljs-string\">'\u793a\u4f8b\u6807\u9898'<\/span>,\r\n              style: Theme\r\n                  .of(context)\r\n                  .primaryTextTheme\r\n                  .title,\r\n            ),\r\n          ),\r\n          <span class=\"hljs-keyword\">new<\/span> Expanded(\r\n            child: <span class=\"hljs-keyword\">new<\/span> Center(\r\n              child: <span class=\"hljs-keyword\">new<\/span> Text(<span class=\"hljs-string\">'\u4f60\u597d\u4e16\u754c\uff01'<\/span>),\r\n            ),\r\n          )\r\n        ],\r\n      ),\r\n    );\r\n  }\r\n}\r\n\r\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">main<\/span><span class=\"hljs-params\">()<\/span> <\/span>{\r\n  runApp(<span class=\"hljs-keyword\">new<\/span> MaterialApp(\r\n    title: <span class=\"hljs-string\">'\u6211\u7684\u5e94\u7528'<\/span>,\r\n    home: <span class=\"hljs-keyword\">new<\/span> MyScaffold(),\r\n  ));\r\n}\r\n<\/code><\/pre>\n<div class=\"image-package\">\n<div class=\"image-container\">\n<div class=\"image-container-fill\"><\/div>\n<div class=\"image-view\" data-width=\"404\" data-height=\"717\"><img decoding=\"async\" class=\"\" src=\"\/\/upload-images.jianshu.io\/upload_images\/5666077-575b9f76ed038388.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/404\" data-original-src=\"\/\/upload-images.jianshu.io\/upload_images\/5666077-575b9f76ed038388.png\" data-original-width=\"404\" data-original-height=\"717\" data-original-format=\"image\/png\" data-original-filesize=\"20288\" \/><\/div>\n<\/div>\n<div class=\"image-caption\"><\/div>\n<\/div>\n<p>\u5176\u5b9e\u8bf4\u771f\u7684\u6211\u7b2c\u4e00\u773c\u770b\u5230\u8fd9\u6bb5\u4ee3\u7801\u7684\u65f6\u5019\uff0c\u7b2c\u4e00\u60f3\u6cd5\u5c31\u662f\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u6709\u8fd9\u4e48\u591a\u62ec\u53f7\uff1f\u4f46\u662f\u8fd9\u4e0d\u662f\u91cd\u70b9\uff0c\u6709\u70b9\u7f16\u7a0b\u7ecf\u9a8c\u7684\u90fd\u77e5\u9053\u8981\u5148\u4ecemain\u51fd\u6570\u770b\u8d77\uff0c\u8fd9\u91cc\u7684main\u51fd\u6570\u91cc\u9762\u5957\u4e86\u4e00\u4e2arunApp\u51fd\u6570\uff0c<\/p>\n<blockquote><p>runApp\u51fd\u6570\u63a5\u53d7\u6307\u5b9a\u7684\u63a7\u4ef6(Widget)\uff0c\u5e76\u4f7f\u5176\u4f5c\u4e3a\u63a7\u4ef6\u6811(widget tree)\u7684\u6839\u63a7\u4ef6\u3002<\/p><\/blockquote>\n<p>runApp\u91cc\u9762new\u4e86\u4e00\u4e2aMaterialApp\u5bf9\u8c61\uff0c\u7136\u540e\u8fd9\u4e2a\u5bf9\u8c61\u6709\u4e24\u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u662ftitile\uff0c\u6307\u660e\u4e86\u8fd9\u4e2a\u63a7\u4ef6\u7684\u6807\u9898\u662f\u5565\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662fhome\uff0c\u6307\u660e\u4e86\u8fd9\u4e2a\u63a7\u4ef6\u7684\u4e3b\u4f53\u662f\u5565\u3002<br \/>\n\u518d\u6df1\u5165\u7684\u770b\u5c31\u4f1a\u53d1\u73b0\uff0chome\u7684\u503c\u662f\u4e00\u4e2anew\u51fa\u6765\u7684MyScaffold\u5bf9\u8c61\uff0c\u8fd9\u65f6\u6211\u4eec\u5c31\u53ef\u4ee5\u53bb\u67e5\u770bMyScaffold\u8fd9\u4e2a\u7c7b\u7684\u58f0\u660e\u4ee3\u7801\u3002<\/p>\n<p>MyScaffold\u63a7\u4ef6\u4e3a\u5b50\u63a7\u4ef6\u8bbe\u7f6e\u5782\u76f4\u5e03\u5c40\uff0c\u5728\u5782\u76f4\u9876\u90e8\u653e\u7f6e\u4e00\u4e2aMyAppBar\u7684\u5b9e\u4f8b\uff08\u8fd9\u4e2a\u63a7\u4ef6\u4e5f\u662f\u81ea\u5df1\u521b\u5efa\u7684\uff09\uff0c\u5c06MyAppBar\u7684Text\u63a7\u4ef6\u4f5c\u4e3a\u6807\u9898\u4f7f\u7528\uff0c\u5c06\u63a7\u4ef6\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u5176\u4ed6\u63a7\u4ef6\u975e\u5e38\u65b9\u4fbf\u5b9e\u7528\u7684\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u901a\u7528\u7684\u63a7\u4ef6\uff0c\u4ee5\u5404\u79cd\u65b9\u5f0f\u91cd\u590d\u7684\u4f7f\u7528\u3002\u6700\u540e\uff0cMyScaffold\u4f7f\u7528Expanded\uff0c\u7528\u4e00\u4e2a\u4e2d\u5fc3\u6587\u672c\u6765\u586b\u5145\u5269\u4f59\u7684\u7a7a\u95f4\u3002<\/p>\n<p>MyAppBar\u63a7\u4ef6\u521b\u5efa\u4e86\u4e00\u4e2aContainer(\u5bb9\u5668)\uff0c\u9ad8\u5ea6\u4e3a56\u8bbe\u5907\u65e0\u5173\u50cf\u7d20(device-independent pixels)\uff0c\u5185\u90e8\u5de6\u53f3\u586b\u51458\u50cf\u7d20(pixels)\u3002\u5728\u5bb9\u5668\u5185\u90e8\uff0cMyAppBar\u4e3a\u5b50\u63a7\u4ef6\u8bbe\u7f6eRow(\u6c34\u5e73)\u5e03\u5c40\uff0c\u4e2d\u95f4\u7684title\u63a7\u4ef6\u88ab\u8bbe\u7f6e\u6210Expanded\uff0cExpanded\u7684\u4f5c\u7528\u662f\u5c55\u5f00Row\u3001Column\u548cFlex\u7684\u5b50\u63a7\u4ef6\uff0c\u610f\u5473\u5b83\u53ef\u4ee5\u4f7f\u7528\u5269\u4f59\u7684\u6240\u6709\u7a7a\u95f4\u3002<\/p>\n<p>\u5176\u5b9e\u4e0a\u8ff0\u7684\u5206\u6790\u8fc7\u7a0b\u5c31\u662f\u4e00\u4e2a\u5bf9\u63a7\u4ef6\u6570\u7684\u4e00\u4e2a\u904d\u5386\uff0c\u4ece\u6839\u63a7\u4ef6\u5230\u91cc\u9762\u7684\u5b50\u63a7\u4ef6\uff0cFlutter\u7684\u8bbe\u8ba1\u7406\u5ff5\u5c31\u662f\u4e00\u5207\u7686\u4e3a\u63a7\u4ef6\uff0c\u7ec4\u4ef6\u5957\u7ec4\u5efa\u3002\u867d\u7136\u4e0a\u8ff0\u4ee3\u7801\u4e0d\u662fjava\uff0cc\u7b49\u4e3b\u6d41\u4ee3\u7801\uff0c\u4f46\u662f\u7406\u89e3\u8d77\u6765\u5374\u5e76\u4e0d\u662f\u975e\u5e38\u96be\u61c2\uff0c\u4e0a\u624b\u96be\u5ea6\u786e\u5b9e\u4e0d\u5927\uff0c\u503c\u5f97\u4f53\u9a8c\u3002<\/p>\n<p>\u6700\u540e\uff0c\u63a8\u8350\u4e00\u4e9b\u94fe\u63a5\uff1a<br \/>\n<a href=\"https:\/\/link.jianshu.com?t=https%3A%2F%2Fflutter.io%2F\" target=\"_blank\" rel=\"nofollow noopener\">Flutter\u5b98\u7f51<\/a><br \/>\n<a href=\"https:\/\/link.jianshu.com?t=http%3A%2F%2Fblog.csdn.net%2Fcolumn%2Fdetails%2F13593.html\" target=\"_blank\" rel=\"nofollow noopener\">Flutter\u6559\u7a0b<\/a><br \/>\n<a href=\"https:\/\/link.jianshu.com?t=http%3A%2F%2Fflutter-dev.cn%2F\" target=\"_blank\" rel=\"nofollow noopener\">Flutter\u4e2d\u6587\u5f00\u53d1\u8005\u8bba\u575b<\/a><\/p>\n<\/div>\n<p>\u4f5c\u8005\uff1a\u96c7\u4e2a\u57ce\u7ba1\u6253\u5929\u4e0b<br \/>\n\u94fe\u63a5\uff1ahttps:\/\/www.jianshu.com\/p\/8baa8ed2414d<br \/>\n\u4f86\u6e90\uff1a\u7b80\u4e66<br \/>\n\u8f6c\u8f7d\u81ea\u7b80\u4e66\uff0c\u8457\u4f5c\u6743\u5f52\u4f5c\u8005\u6240\u6709\uff0c\u4efb\u4f55\u5f62\u5f0f\u7684\u8f6c\u8f7d\u90fd\u8bf7\u8054\u7cfb\u4f5c\u8005\u83b7\u5f97\u6388\u6743\u5e76\u6ce8\u660e\u51fa\u5904\u3002<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662fFlutter 2018\u5e742\u670827\u65e5\uff0c\u57282018\u4e16\u754c\u79fb\u52a8\u5927\u4f1a\u4e0a\uff0cGoogle\u53d1\u5e03\u4e86Flutte &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9],"series":[],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-programmers","tag-flutter"],"_links":{"self":[{"href":"https:\/\/fick707.com\/index.php?rest_route=\/wp\/v2\/posts\/134"}],"collection":[{"href":"https:\/\/fick707.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fick707.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fick707.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fick707.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134"}],"version-history":[{"count":1,"href":"https:\/\/fick707.com\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":135,"href":"https:\/\/fick707.com\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions\/135"}],"wp:attachment":[{"href":"https:\/\/fick707.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fick707.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fick707.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/fick707.com\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}