{"id":120208,"date":"2026-10-31T07:25:07","date_gmt":"2026-10-30T23:25:07","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/120208.html"},"modified":"2026-10-31T07:25:07","modified_gmt":"2026-10-30T23:25:07","slug":"%e3%80%90flutter%e8%b8%a9%e5%9d%91%e6%8e%92%e9%9b%b7%e3%80%91%e7%ac%ac9%e8%af%be%ef%bc%9a%e5%b0%ba%e5%af%b8%e7%a1%ac%e7%bc%96%e7%a0%81%e5%9d%91%ef%bd%9c%e5%9b%ba%e5%ae%9a%e5%b0%ba%e5%af%b8%ef%bc%8c","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/120208.html","title":{"rendered":"\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d"},"content":{"rendered":"<h3>\u6458\u8981<\/h3>\n<p>\u672c\u6587\u805a\u7126 Flutter \u5e03\u5c40\u4e2d\u300c\u5c3a\u5bf8\u786c\u7f16\u7801\u300d\u8fd9\u4e00\u9ad8\u9891\u5374\u9690\u853d\u7684\u6545\u969c\u6e90\u3002\u4ece\u4e09\u79cd\u5178\u578b\u300c\u9519\u4e71\u59ff\u6001\u300d\u5207\u5165\u2014\u2014\u4f2a\u52a8\u6001\u8ba1\u7b97\u3001\u56fa\u5b9a\u9ad8\u5ea6\u53e0\u52a0\u6587\u672c\u7f29\u653e\u3001\u903b\u8f91\u50cf\u7d20\u4e0e\u7269\u7406\u50cf\u7d20\u6df7\u6dc6\u2014\u2014\u63ed\u793a\u5176\u5171\u540c\u6839\u56e0&#xff1a;\u7528\u300c\u6570\u503c\u786e\u5b9a\u6027\u300d\u66ff\u4ee3\u4e86\u300c\u7ea6\u675f\u534f\u5546\u300d\u3002\u968f\u540e\u5f52\u7eb3\u56db\u79cd\u7ecf\u5178\u6545\u969c\u6a21\u5f0f&#xff0c;\u7ed9\u51fa\u4e94\u6b65\u7cfb\u7edf\u6027\u6392\u67e5\u65b9\u6cd5\u8bba&#xff0c;\u5e76\u6309\u573a\u666f\u5206\u4e94\u5c42\u9012\u8fdb\u4fee\u590d&#xff1a;\u5f39\u6027\u7ea6\u675f\u3001LayoutBuilder \u5c40\u90e8\u51b3\u7b56\u3001\u5185\u5bb9\u9a71\u52a8\u9ad8\u5ea6\u3001devicePixelRatio \u5904\u7406\u7269\u7406\u50cf\u7d20\u610f\u56fe\u3001\u65ad\u70b9\u5206\u652f\u5904\u7406\u7ed3\u6784\u53d8\u5316\u3002\u6700\u540e\u6c89\u6dc0\u4e94\u6761\u9884\u9632\u539f\u5219&#xff0c;\u914d\u5957 15 \u9053\u8bfe\u540e\u4e60\u9898&#xff0c;\u5e2e\u52a9\u8bfb\u8005\u628a\u300c\u5c3a\u5bf8\u51b3\u7b56\u300d\u4ece\u5199\u6b7b\u6570\u503c\u8f6c\u53d8\u4e3a\u57fa\u4e8e\u7ea6\u675f\u4e0e\u4e0a\u4e0b\u6587\u7684\u63a8\u7406\u3002<\/p>\n<p>\u5173\u952e\u8bcd&#xff1a;Flutter \u5e03\u5c40&#xff1b;\u786c\u7f16\u7801\u5c3a\u5bf8&#xff1b;\u7ea6\u675f\u534f\u5546&#xff1b;\u6587\u672c\u7f29\u653e&#xff1b;\u903b\u8f91\u50cf\u7d20&#xff1b;\u54cd\u5e94\u5f0f\u9002\u914d<\/p>\n<h3>\u76ee\u5f55<\/h3>\n<ul>\n<li>\u6458\u8981<\/li>\n<li>\u524d\u8a00<\/li>\n<li>\u4e00\u3001\u6545\u969c\u73b0\u573a&#xff1a;\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u4e09\u79cd&#034;\u9519\u4e71\u59ff\u6001&#034;\n<ul>\n<li>\u59ff\u6001\u4e00&#xff1a;\u4f2a\u52a8\u6001\u8ba1\u7b97\u2014\u2014&#034;\u6309\u5c4f\u5e55\u6bd4\u4f8b\u7b97&#034;\u5374\u5728\u5c0f\u5c4f\u4e0a\u4ecd\u7136\u9519\u4f4d<\/li>\n<li>\u59ff\u6001\u4e8c&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6 &#043; \u6587\u672c\u7f29\u653e\u2014\u2014\u6587\u5b57\u6491\u7834\u5bb9\u5668&#xff0c;\u6309\u94ae\u88ab\u63a8\u51fa\u5c4f\u5e55<\/li>\n<li>\u59ff\u6001\u4e09&#xff1a;\u7269\u7406\u50cf\u7d20\u4e0e\u903b\u8f91\u50cf\u7d20\u7684\u6df7\u6dc6\u2014\u20141px \u8fb9\u6846\u7684\u6a21\u7cca\u4e0e\u6d88\u5931<\/li>\n<\/ul>\n<\/li>\n<li>\u4e8c\u3001\u6839\u56e0\u5256\u6790&#xff1a;\u786c\u7f16\u7801\u5c3a\u5bf8\u662f\u5728\u7528&#034;\u6570\u503c\u786e\u5b9a\u6027&#034;\u66ff\u4ee3&#034;\u7ea6\u675f\u534f\u5546&#034;\n<ul>\n<li>2.1 Flutter \u7684\u5c3a\u5bf8\u4e0d\u662f&#034;\u88ab\u8bbe\u5b9a&#034;\u7684&#xff0c;\u800c\u662f&#034;\u88ab\u534f\u5546&#034;\u7684<\/li>\n<li>2.2 \u903b\u8f91\u50cf\u7d20\u662f&#034;\u89c6\u89c9\u5c3a\u5bf8&#034;&#xff0c;\u4e0d\u662f&#034;\u7269\u7406\u5c3a\u5bf8&#034;<\/li>\n<li>2.3 \u6587\u672c\u7f29\u653e\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u3001\u4e0e\u5c4f\u5e55\u5c3a\u5bf8\u6b63\u4ea4\u7684\u7ef4\u5ea6<\/li>\n<li>2.4 &#034;\u56fa\u5b9a\u5c3a\u5bf8&#034;\u5728\u8bed\u4e49\u4e0a\u53ef\u80fd\u662f\u6b63\u786e\u7684&#xff0c;\u4f46&#034;\u56fa\u5b9a\u7684\u6570\u503c&#034;\u51e0\u4e4e\u4ece\u4e0d\u6b63\u786e<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001\u7ecf\u5178\u6545\u969c\u6a21\u5f0f\u4e0e\u6df1\u5165\u6848\u4f8b\n<ul>\n<li>\u6a21\u5f0f\u4e00&#xff1a;screen_utils &#043; Figma \u56fa\u5b9a\u8bbe\u8ba1\u7a3f\u2014\u2014\u5c0f\u5c4f\u4e0a\u7684&#034;\u6bd4\u4f8b\u7f29\u653e&#034;\u5931\u6548<\/li>\n<li>\u6a21\u5f0f\u4e8c&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6\u6587\u672c\u5bb9\u5668\u7684&#034;\u7ea7\u8054\u5d29\u6e83&#034;\u2014\u2014\u4ece\u88c1\u526a\u5230\u5217\u8868\u8df3\u52a8<\/li>\n<li>\u6a21\u5f0f\u4e09&#xff1a;1px \u8fb9\u6846\u5728\u5206\u6570 DPR \u4e0b\u7684\u6a21\u7cca\u4e0e\u88c1\u526a<\/li>\n<li>\u6a21\u5f0f\u56db&#xff1a;\u6a2a\u7ad6\u5c4f\u5207\u6362\u4e2d\u7684\u56fa\u5b9a\u5c3a\u5bf8\u2014\u2014\u201c\u5728\u7ad6\u5c4f\u80fd\u7528\u7684\u5bbd\u5ea6&#xff0c;\u5728\u6a2a\u5c4f\u53d8\u6210\u4e86\u9ad8\u5ea6\u201d<\/li>\n<\/ul>\n<\/li>\n<li>\u56db\u3001\u7cfb\u7edf\u6027\u6392\u67e5\u65b9\u6cd5\u8bba\n<ul>\n<li>\u7b2c\u4e00\u6b65&#xff1a;\u533a\u5206&#034;\u6709\u8bed\u4e49\u7684\u56fa\u5b9a\u5c3a\u5bf8&#034;\u4e0e&#034;\u6570\u503c\u786c\u7f16\u7801&#034;<\/li>\n<li>\u7b2c\u4e8c\u6b65&#xff1a;\u5728 DevTools \u4e2d\u68c0\u67e5&#034;\u7ea6\u675f&#034;\u800c\u4e0d\u662f&#034;\u5c3a\u5bf8&#034;<\/li>\n<li>\u7b2c\u4e09\u6b65&#xff1a;\u5728\u6587\u672c\u7f29\u653e\u4e0b\u505a\u4e13\u9879\u6d4b\u8bd5<\/li>\n<li>\u7b2c\u56db\u6b65&#xff1a;\u7528 LayoutBuilder \u533a\u5206&#034;\u5c4f\u5e55\u5c3a\u5bf8&#034;\u4e0e&#034;\u5c40\u90e8\u7ea6\u675f&#034;<\/li>\n<li>\u7b2c\u4e94\u6b65&#xff1a;\u533a\u5206&#034;\u5c3a\u5bf8\u95ee\u9898&#034;\u4e0e&#034;\u5e03\u5c40\u7ed3\u6784\u95ee\u9898&#034;<\/li>\n<\/ul>\n<\/li>\n<li>\u4e94\u3001\u4fee\u590d\u65b9\u6848&#xff1a;\u6309\u573a\u666f\u5339\u914d\u66ff\u4ee3\u7b56\u7565\n<ul>\n<li>\u7b2c\u4e00\u5c42&#xff1a;\u7528\u5f39\u6027\u7ea6\u675f\u66ff\u4ee3\u56fa\u5b9a\u5c3a\u5bf8<\/li>\n<li>\u7b2c\u4e8c\u5c42&#xff1a;\u7528 LayoutBuilder \u66ff\u4ee3 MediaQuery.sizeOf \u505a\u5c40\u90e8\u5c3a\u5bf8\u51b3\u7b56<\/li>\n<li>\u7b2c\u4e09\u5c42&#xff1a;\u8ba9\u6587\u672c\u5bb9\u5668\u7684\u9ad8\u5ea6\u7531\u5185\u5bb9\u51b3\u5b9a&#xff0c;\u800c\u4e0d\u662f\u7531\u56fa\u5b9a\u503c\u51b3\u5b9a<\/li>\n<li>\u7b2c\u56db\u5c42&#xff1a;\u7528 devicePixelRatio \u5904\u7406\u7269\u7406\u50cf\u7d20\u610f\u56fe&#xff0c;\u800c\u4e0d\u662f\u7528\u903b\u8f91\u50cf\u7d20\u731c\u6d4b<\/li>\n<li>\u7b2c\u4e94\u5c42&#xff1a;\u7528\u65ad\u70b9\u5206\u652f\u5904\u7406&#034;\u5e03\u5c40\u7ed3\u6784\u9700\u8981\u53d8\u5316&#034;\u7684\u573a\u666f<\/li>\n<\/ul>\n<\/li>\n<li>\u516d\u3001\u9884\u9632\u4f53\u7cfb&#xff1a;\u8ba9\u5c3a\u5bf8\u51b3\u7b56\u4ece&#034;\u6570\u503c&#034;\u53d8\u4e3a&#034;\u7ea6\u675f&#034;\n<ul>\n<li>\u539f\u5219\u4e00&#xff1a;\u9ed8\u8ba4\u4f7f\u7528\u5f39\u6027\u7ea6\u675f&#xff0c;\u56fa\u5b9a\u5c3a\u5bf8\u9700\u8981\u7406\u7531<\/li>\n<li>\u539f\u5219\u4e8c&#xff1a;\u5bf9\u5305\u542b\u6587\u672c\u7684\u5bb9\u5668&#xff0c;\u9ed8\u8ba4\u4e0d\u4f7f\u7528\u56fa\u5b9a\u9ad8\u5ea6<\/li>\n<li>\u539f\u5219\u4e09&#xff1a;\u533a\u5206 MediaQuery.sizeOf \u4e0e LayoutBuilder \u7684\u9002\u7528\u8fb9\u754c<\/li>\n<li>\u539f\u5219\u56db&#xff1a;\u628a devicePixelRatio \u5f53\u4f5c&#034;\u7269\u7406\u50cf\u7d20\u6e32\u67d3&#034;\u7684\u5de5\u5177&#xff0c;\u800c\u4e0d\u662f&#034;\u5e03\u5c40&#034;\u7684\u5de5\u5177<\/li>\n<li>\u539f\u5219\u4e94&#xff1a;\u5728 CI \u548c\u8bbe\u5907\u77e9\u9635\u4e2d\u8986\u76d6&#034;\u6781\u7aef\u4f46\u5408\u6cd5&#034;\u7684\u914d\u7f6e<\/li>\n<\/ul>\n<\/li>\n<li>\u4e03\u3001\u8bfe\u540e\u4e60\u9898&#xff08;15\u9053&#xff09;<\/li>\n<li>\u516b\u3001\u672c\u8282\u8bfe\u77e5\u8bc6\u8981\u70b9\u603b\u7ed3<\/li>\n<li>\u4e5d\u3001\u4e0b\u8282\u8bfe\u9884\u544a## \u524d\u8a00<\/li>\n<\/ul>\n<p>\u5728 Flutter \u91cc&#xff0c;\u6700\u5bb9\u6613\u88ab\u5ffd\u89c6\u7684\u6545\u969c\u6e90\u5f80\u5f80\u4e0d\u662f\u62a5\u9519&#xff0c;\u800c\u662f\u90a3\u4e9b&#034;\u770b\u8d77\u6765\u6ca1\u95ee\u9898&#034;\u7684\u56fa\u5b9a\u6570\u503c\u3002width: 100\u3001height: 200\u3001fontSize: 16\u2014\u2014\u5b83\u4eec\u5728\u5f00\u53d1\u8005\u7684\u8bbe\u5907\u4e0a\u5b8c\u7f8e\u8fd0\u884c&#xff0c;\u5374\u5728\u6362\u4e00\u53f0\u624b\u673a\u3001\u8c03\u5927\u7cfb\u7edf\u5b57\u4f53\u3001\u6216\u65cb\u8f6c\u5c4f\u5e55\u540e\u96c6\u4f53\u5931\u914d\u3002<\/p>\n<p>\u672c\u8bfe\u805a\u7126&#034;\u5c3a\u5bf8\u786c\u7f16\u7801&#034;\u8fd9\u4e00\u9690\u853d\u800c\u9ad8\u9891\u7684\u5751&#xff1a;\u5148\u8fd8\u539f\u4e09\u79cd\u5178\u578b\u9519\u4e71\u59ff\u6001&#xff0c;\u518d\u5256\u6790\u5176\u5171\u540c\u6839\u56e0\u2014\u2014\u7528\u6570\u503c\u786e\u5b9a\u6027\u66ff\u4ee3\u7ea6\u675f\u534f\u5546&#xff1b;\u968f\u540e\u7ed9\u51fa\u56db\u79cd\u7ecf\u5178\u6545\u969c\u6a21\u5f0f\u3001\u4e94\u6b65\u6392\u67e5\u65b9\u6cd5\u8bba\u4e0e\u4e94\u5c42\u4fee\u590d\u7b56\u7565&#xff0c;\u6700\u540e\u6c89\u6dc0\u4e94\u6761\u9884\u9632\u539f\u5219\u548c 15 \u9053\u4e60\u9898\u3002\u8bfb\u5b8c\u540e&#xff0c;\u4f60\u5e94\u5f53\u80fd\u628a&#034;\u5c3a\u5bf8\u51b3\u7b56&#034;\u4ece\u5199\u6b7b\u6570\u503c&#xff0c;\u8f6c\u53d8\u4e3a\u57fa\u4e8e\u7ea6\u675f\u4e0e\u4e0a\u4e0b\u6587\u7684\u63a8\u7406\u3002<\/p>\n<h3>\u4e00\u3001\u6545\u969c\u73b0\u573a&#xff1a;\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u4e09\u79cd\u201c\u9519\u4e71\u59ff\u6001\u201d<\/h3>\n<p>\u524d\u516b\u8bfe\u7684\u6545\u969c\u5927\u591a\u6709\u660e\u786e\u7684\u89e6\u53d1\u70b9&#xff1a;\u7248\u672c\u51b2\u7a81\u7684\u62a5\u9519\u884c\u3001\u7a7a\u6307\u9488\u7684\u5806\u6808\u3001const \u7684\u201c\u4e0d\u5237\u65b0\u201d\u3001Flex \u7684\u9ec4\u9ed1\u6761\u7eb9\u3002\u5c3a\u5bf8\u786c\u7f16\u7801\u7684\u6545\u969c\u6bd4\u5b83\u4eec\u66f4\u5206\u6563\u2014\u2014\u5b83\u4e0d\u96c6\u4e2d\u5728\u67d0\u4e00\u4e2a Widget \u6216\u67d0\u4e00\u6b21\u8c03\u7528\u4e0a&#xff0c;\u800c\u662f\u6563\u5e03\u5728\u6bcf\u4e00\u4e2a\u5199\u4e0b width: 100\u3001height: 200\u3001fontSize: 16 \u7684\u4f4d\u7f6e&#xff0c;\u5728\u8bbe\u5907\u3001\u5b57\u4f53\u8bbe\u7f6e\u6216\u7a97\u53e3\u5c3a\u5bf8\u53d8\u5316\u65f6\u540c\u65f6\u53d1\u4f5c\u3002\u6ca1\u6709\u4e00\u4e2a\u5355\u72ec\u7684\u786c\u7f16\u7801\u503c\u4f1a\u201c\u5d29\u6e83\u201d&#xff0c;\u4f46\u51e0\u5341\u4e2a\u786c\u7f16\u7801\u503c\u53e0\u52a0\u5728\u4e00\u8d77&#xff0c;\u4f1a\u8ba9\u4e00\u4e2a\u5728 Pixel 4 \u4e0a\u5b8c\u7f8e\u7684\u5e03\u5c40&#xff0c;\u5728 Pixel 2 \u6216 iPhone SE \u4e0a\u53d8\u6210\u4e0d\u53ef\u7528\u7684\u9519\u4f4d\u3002<\/p>\n<h4>\u59ff\u6001\u4e00&#xff1a;\u4f2a\u52a8\u6001\u8ba1\u7b97\u2014\u2014\u201c\u6309\u5c4f\u5e55\u6bd4\u4f8b\u7b97\u201d\u5374\u5728\u5c0f\u5c4f\u4e0a\u4ecd\u7136\u9519\u4f4d<\/h4>\n<p>\u8fd9\u662f\u6700\u5177\u6709\u8ff7\u60d1\u6027\u7684\u4e00\u79cd\u6545\u969c&#xff0c;\u56e0\u4e3a\u5b83\u770b\u8d77\u6765\u4e0d\u662f\u786c\u7f16\u7801\u3002\u4e00\u4e2a\u5f00\u53d1\u8005\u6309\u7167\u6559\u7a0b&#xff0c;\u7528\u5c4f\u5e55\u9ad8\u5ea6\u4f5c\u4e3a\u5206\u6bcd\u6765\u201c\u52a8\u6001\u201d\u8ba1\u7b97\u6240\u6709\u5c3a\u5bf8&#xff1a;<\/p>\n<p><span class=\"token keyword\">static<\/span> double pageViewContainer <span class=\"token operator\">&#061;<\/span> screenHeight <span class=\"token operator\">\/<\/span> <span class=\"token number\">3.55<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">static<\/span> double height10 <span class=\"token operator\">&#061;<\/span> screenHeight <span class=\"token operator\">\/<\/span> <span class=\"token number\">78.1<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">static<\/span> double width10 <span class=\"token operator\">&#061;<\/span> screenHeight <span class=\"token operator\">\/<\/span> <span class=\"token number\">78.1<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5728 Pixel 4&#xff08;\u9ad8\u5ea6 781&#xff09;\u4e0a&#xff0c;\u8fd9\u4e9b\u503c\u4ea7\u751f\u4e86\u4e00\u4e2a\u770b\u8d77\u6765\u5408\u7406\u7684\u5e03\u5c40\u3002\u4f46\u6362\u5230 Pixel 2 \u540e&#xff0c;\u5bb9\u5668\u4e0d\u518d\u5c45\u4e2d&#xff0c;\u5e03\u5c40\u9519\u4f4d\u4e86\u3002\u63d0\u95ee\u8005\u7684\u56f0\u60d1\u662f\u51c6\u786e\u7684&#xff1a;\u201c\u6211\u660e\u660e\u7528\u4e86\u52a8\u6001\u8ba1\u7b97&#xff0c;\u4e3a\u4ec0\u4e48\u8fd8\u662f\u4e0d\u5bf9&#xff1f;\u201d<\/p>\n<p>\u6839\u56e0\u5728\u4e8e&#xff1a;\u8fd9\u79cd\u201c\u52a8\u6001\u201d\u8ba1\u7b97\u53ea\u6539\u53d8\u4e86\u6570\u503c\u7684\u6765\u6e90&#xff0c;\u6ca1\u6709\u6539\u53d8\u5c3a\u5bf8\u7684\u8bbe\u8ba1\u8bed\u4e49\u3002screenHeight \/ 3.55 \u4ecd\u7136\u662f\u4e00\u4e2a\u56fa\u5b9a\u7684\u6bd4\u4f8b\u503c&#xff0c;\u5b83\u4e0d\u5173\u5fc3\u5bb9\u5668\u7684\u5185\u5bb9\u3001\u53ef\u7528\u7684\u5bbd\u5ea6\u3001\u5b57\u4f53\u7f29\u653e\u6216\u5b89\u5168\u533a\u3002\u5f53\u5c4f\u5e55\u9ad8\u5ea6\u4ece 781 \u53d8\u4e3a 731 \u65f6&#xff0c;\u8fd9\u4e2a\u6bd4\u4f8b\u503c\u53d8\u5c0f\u4e86&#xff0c;\u4f46\u5b83\u7684\u53d8\u5c0f\u65b9\u5f0f\u4e0e\u5bb9\u5668\u5185\u90e8\u7684\u5185\u5bb9\u3001padding\u3001\u5144\u5f1f\u7ec4\u4ef6\u7684\u5c3a\u5bf8\u53d8\u5316\u6ca1\u6709\u4efb\u4f55\u534f\u5546\u3002\u5bbd\u5ea6\u7684\u8ba1\u7b97\u751a\u81f3\u4f7f\u7528\u4e86 screenHeight \u4f5c\u4e3a\u5206\u6bcd&#xff08;width10 &#061; screenHeight \/ 78.1&#xff09;&#xff0c;\u8fd9\u610f\u5473\u7740\u5bbd\u5ea6\u7684\u7f29\u653e\u5b8c\u5168\u8ddf\u968f\u9ad8\u5ea6\u2014\u2014\u5728\u6a2a\u5c4f\u6216\u4e0d\u540c\u5bbd\u9ad8\u6bd4\u7684\u8bbe\u5907\u4e0a&#xff0c;\u8fd9\u79cd\u8ba1\u7b97\u4f1a\u4ea7\u751f\u4e0e\u8bbe\u8ba1\u610f\u56fe\u65e0\u5173\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u8fd9\u4e2a\u59ff\u6001\u7684\u6559\u8bad\u4e0d\u662f\u201c\u4e0d\u8981\u7528\u6bd4\u4f8b\u201d&#xff0c;\u800c\u662f&#xff1a;\u5c3a\u5bf8\u5e94\u8be5\u7531\u7ea6\u675f\u548c\u5185\u5bb9\u534f\u5546\u4ea7\u751f&#xff0c;\u800c\u4e0d\u662f\u7531\u5c4f\u5e55\u7684\u67d0\u4e00\u4e2a\u7ef4\u5ea6\u9664\u4ee5\u4e00\u4e2a\u9b54\u6cd5\u6570\u5b57\u4ea7\u751f\u3002\u7528\u5c4f\u5e55\u9ad8\u5ea6\u505a\u9664\u6570&#xff0c;\u672c\u8d28\u4e0a\u662f\u7528\u4e00\u4e2a\u66f4\u590d\u6742\u7684\u786c\u7f16\u7801\u66ff\u4ee3\u4e86\u7b80\u5355\u7684\u786c\u7f16\u7801\u3002<\/p>\n<h4>\u59ff\u6001\u4e8c&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6 &#043; \u6587\u672c\u7f29\u653e\u2014\u2014\u6587\u5b57\u6491\u7834\u5bb9\u5668&#xff0c;\u6309\u94ae\u88ab\u63a8\u51fa\u5c4f\u5e55<\/h4>\n<p>\u4e00\u4e2a SizedBox(height: 100) \u5305\u88f9\u7740\u4e00\u4e2a\u5305\u542b\u6807\u9898\u548c\u526f\u6807\u9898\u7684 Card\u3002\u5728 100% \u5b57\u4f53\u7f29\u653e\u8bbe\u7f6e\u4e0b&#xff0c;\u5e03\u5c40\u770b\u8d77\u6765\u5b8c\u7f8e\u3002\u5f53\u7528\u6237\u5c06\u7cfb\u7edf\u5b57\u4f53\u653e\u5927\u5230 160% \u65f6&#xff0c;\u4e24\u884c\u6587\u672c\u7684\u603b\u9ad8\u5ea6\u8d85\u8fc7\u4e86 100 \u903b\u8f91\u50cf\u7d20&#xff0c;SizedBox \u65e0\u6cd5\u5bb9\u7eb3\u5185\u5bb9&#xff0c;\u6587\u672c\u88ab\u88c1\u526a&#xff0c;\u6216\u8005\u89e6\u53d1\u6ea2\u51fa\u3002<\/p>\n<p>\u8fd9\u4e2a\u6545\u969c\u7684\u673a\u5236\u662f&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6\u9884\u8bbe\u4e86\u4e00\u4e2a\u201c\u6587\u672c\u4f1a\u5360\u7528\u591a\u5c11\u7a7a\u95f4\u201d\u7684\u5047\u8bbe&#xff0c;\u800c\u5b57\u4f53\u7f29\u653e\u6253\u7834\u4e86\u5b83\u3002TextScaler \u5728\u5e03\u5c40\u4e4b\u524d\u8c03\u6574\u4e86\u6587\u672c\u7684\u7f29\u653e\u56e0\u5b50&#xff0c;TextPainter \u6839\u636e\u65b0\u7684\u7f29\u653e\u56e0\u5b50\u8ba1\u7b97\u6587\u672c\u7684\u56fa\u6709\u5c3a\u5bf8&#xff1b;\u4f46 SizedBox(height: 100) \u7684\u7ea6\u675f\u662f\u5728\u6587\u672c\u5e03\u5c40\u4e4b\u524d\u5c31\u5df2\u7ecf\u786e\u5b9a\u7684&#xff0c;\u5b83\u4e0d\u4f1a\u56e0\u4e3a\u6587\u672c\u53d8\u9ad8\u800c\u81ea\u52a8\u6269\u5c55\u3002Card \u5185\u90e8\u7684 Column \u8bd5\u56fe\u5728 100 \u50cf\u7d20\u5185\u5b89\u6392\u653e\u5927\u7684\u6587\u672c&#xff0c;\u534f\u5546\u5931\u8d25\u3002<\/p>\n<p>\u66f4\u4e25\u91cd\u7684\u53d8\u4f53\u51fa\u73b0\u5728\u6309\u94ae\u4e0a\u3002\u4e00\u4e2a\u8bbe\u8ba1\u4e3a 48 \u50cf\u7d20\u9ad8\u7684 ElevatedButton&#xff0c;\u5728 200% \u5b57\u4f53\u7f29\u653e\u4e0b&#xff0c;\u6309\u94ae\u5185\u90e8\u7684\u6587\u672c\u53ef\u80fd\u88ab\u88c1\u526a&#xff0c;\u6216\u8005\u6309\u94ae\u7684\u56fa\u5b9a\u9ad8\u5ea6\u8feb\u4f7f\u6587\u672c\u7f29\u5c0f\u5230\u4e0d\u53ef\u8bfb\u7684\u5c3a\u5bf8\u3002\u5982\u679c\u6309\u94ae\u4f4d\u4e8e\u5c4f\u5e55\u5e95\u90e8&#xff0c;\u653e\u5927\u7684\u6587\u672c\u8fd8\u53ef\u80fd\u5c06\u201c\u786e\u8ba4\u201d\u4e4b\u7c7b\u7684\u5173\u952e\u64cd\u4f5c\u63a8\u51fa\u53ef\u89c6\u533a\u57df&#xff0c;\u4f7f\u529f\u80fd\u5728\u65e0\u969c\u788d\u8bbe\u7f6e\u4e0b\u4e0d\u53ef\u7528\u3002flutter-skills \u7684\u6280\u80fd\u63cf\u8ff0\u7cbe\u786e\u5730\u6982\u62ec\u4e86\u8fd9\u6761\u6545\u969c\u94fe&#xff1a;\u201cEnlarged system font scale (TextScaler) causes text to clip inside fixed-height containers or push critical actions offscreen\u201d\u3002<\/p>\n<h4>\u59ff\u6001\u4e09&#xff1a;\u7269\u7406\u50cf\u7d20\u4e0e\u903b\u8f91\u50cf\u7d20\u7684\u6df7\u6dc6\u2014\u20141px \u8fb9\u6846\u7684\u6a21\u7cca\u4e0e\u6d88\u5931<\/h4>\n<p>\u4e00\u4e2a\u5f00\u53d1\u8005\u5728 Container \u4e0a\u8bbe\u7f6e border: Border.all(width: 1)&#xff0c;\u671f\u671b\u5728\u5c4f\u5e55\u4e0a\u770b\u5230\u4e00\u6761\u201c\u6e05\u6670\u7684 1 \u50cf\u7d20\u8fb9\u6846\u201d\u3002\u5728 devicePixelRatio \u4e3a 1 \u7684\u8bbe\u5907\u4e0a&#xff0c;1 \u903b\u8f91\u50cf\u7d20\u6070\u597d\u5bf9\u5e94 1 \u7269\u7406\u50cf\u7d20&#xff0c;\u8fb9\u6846\u6e05\u6670\u3002\u5728 devicePixelRatio \u4e3a 2 \u7684\u8bbe\u5907\u4e0a&#xff0c;1 \u903b\u8f91\u50cf\u7d20\u5bf9\u5e94 2 \u7269\u7406\u50cf\u7d20&#xff0c;\u8fb9\u6846\u53d8\u6210 2 \u7269\u7406\u50cf\u7d20\u5bbd&#xff0c;\u89c6\u89c9\u4e0a\u6bd4\u9884\u671f\u7c97\u3002\u5728\u5206\u6570 devicePixelRatio&#xff08;\u4f8b\u5982 1.25 \u6216 2.625&#xff09;\u7684\u8bbe\u5907\u4e0a&#xff0c;1 \u903b\u8f91\u50cf\u7d20\u7684\u8fb9\u6846\u53ef\u80fd\u843d\u5728\u7269\u7406\u50cf\u7d20\u7684\u975e\u6574\u6570\u8fb9\u754c\u4e0a&#xff0c;\u5f15\u64ce\u8fdb\u884c\u6297\u952f\u9f7f\u6216\u53d6\u6574\u5904\u7406&#xff0c;\u7ed3\u679c\u662f\u8fb9\u6846\u6a21\u7cca&#xff0c;\u6216\u8005\u5728\u6781\u7aef\u60c5\u51b5\u4e0b\u90e8\u5206\u8fb9\u7f18\u88ab\u88c1\u526a\u3002<\/p>\n<p>devicePixelRatio \u7684\u5b9a\u4e49\u662f\u201c\u6bcf\u4e2a\u903b\u8f91\u50cf\u7d20\u5bf9\u5e94\u7684\u7269\u7406\u50cf\u7d20\u6570\u91cf\u201d&#xff0c;\u5b83\u53ef\u80fd\u4e0d\u662f 2 \u7684\u5e42&#xff0c;\u751a\u81f3\u53ef\u80fd\u4e0d\u662f\u6574\u6570\u2014\u2014Nexus 6 \u7684 DPR \u5c31\u662f 3.5\u3002Flutter \u6846\u67b6\u5728\u903b\u8f91\u50cf\u7d20\u4e2d\u8fd0\u884c&#xff0c;\u6240\u4ee5\u201c\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u4e0d\u9700\u8981\u76f4\u63a5\u5904\u7406 devicePixelRatio\u201d\u3002\u4f46\u5f53\u5f00\u53d1\u8005\u8bd5\u56fe\u7528\u903b\u8f91\u50cf\u7d20\u7684\u503c\u53bb\u8868\u8fbe\u4e00\u4e2a\u7269\u7406\u50cf\u7d20\u7ea7\u522b\u7684\u610f\u56fe&#xff08;\u201c\u6211\u8981\u4e00\u6761 1 \u7269\u7406\u50cf\u7d20\u7684\u7ec6\u7ebf\u201d&#xff09;\u65f6&#xff0c;\u903b\u8f91\u50cf\u7d20\u4e0e\u7269\u7406\u50cf\u7d20\u4e4b\u95f4\u7684\u8f6c\u6362\u5c31\u4e0d\u518d\u662f\u900f\u660e\u7684\u3002\u4f8b\u5982\u5728 DPR \u4e3a 1.25 \u7684\u8bbe\u5907\u4e0a&#xff0c;\u8981\u7ed8\u5236 1 \u7269\u7406\u50cf\u7d20\u5bbd\u7684\u8fb9\u6846&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u8bbe\u7f6e\u5bbd\u5ea6\u4e3a 1.0 \u903b\u8f91\u50cf\u7d20&#xff0c;\u800c\u5e94\u8be5\u8bbe\u7f6e\u4e3a 0.8 \u903b\u8f91\u50cf\u7d20\u3002\u628a\u903b\u8f91\u50cf\u7d20\u7684\u6570\u503c\u5f53\u4f5c\u7269\u7406\u50cf\u7d20\u6765\u7406\u89e3&#xff0c;\u662f\u8fd9\u7c7b\u6545\u969c\u7684\u6839\u6e90\u3002<\/p>\n<p>devicePixelRatio \u7684\u53e6\u4e00\u4e2a\u9677\u9631\u662f&#xff1a;\u5b83\u662f\u4e00\u4e2a\u53ef\u80fd\u5728\u8fd0\u884c\u65f6\u53d8\u5316\u7684\u503c\u3002\u5f53\u7528\u6237\u66f4\u6539\u7cfb\u7edf\u663e\u793a\u7f29\u653e\u3001\u5c06\u5e94\u7528\u7a97\u53e3\u4ece\u9ad8 DPI \u663e\u793a\u5668\u62d6\u5230\u4f4e DPI \u663e\u793a\u5668\u3001\u6216\u8005\u6298\u53e0\u5c4f\u8bbe\u5907\u5207\u6362\u5f62\u6001\u65f6&#xff0c;devicePixelRatio \u4f1a\u6539\u53d8&#xff0c;\u4f9d\u8d56\u5b83\u7684 Widget \u9700\u8981\u88ab\u91cd\u5efa\u3002\u76f4\u63a5\u7f13\u5b58 devicePixelRatio \u7684\u503c\u5e76\u5728\u540e\u7eed\u5e03\u5c40\u4e2d\u4f7f\u7528&#xff0c;\u4f1a\u5bfc\u81f4\u5e94\u7528\u5728\u663e\u793a\u8bbe\u7f6e\u53d8\u5316\u540e\u4e0d\u518d\u54cd\u5e94\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4e09\u79cd\u201c\u9519\u4e71\u59ff\u6001\u201d\u7684\u6545\u969c\u5168\u666f\u56fe&#xff1a;<\/p>\n<p>  #mermaid-svg-xWqqZ9BqByR74Uor{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-xWqqZ9BqByR74Uor .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-xWqqZ9BqByR74Uor .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-xWqqZ9BqByR74Uor .error-icon{fill:#552222;}#mermaid-svg-xWqqZ9BqByR74Uor .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-xWqqZ9BqByR74Uor .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-xWqqZ9BqByR74Uor .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-xWqqZ9BqByR74Uor .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-xWqqZ9BqByR74Uor .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-xWqqZ9BqByR74Uor .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-xWqqZ9BqByR74Uor .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-xWqqZ9BqByR74Uor .marker{fill:#333333;stroke:#333333;}#mermaid-svg-xWqqZ9BqByR74Uor .marker.cross{stroke:#333333;}#mermaid-svg-xWqqZ9BqByR74Uor svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-xWqqZ9BqByR74Uor p{margin:0;}#mermaid-svg-xWqqZ9BqByR74Uor .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-xWqqZ9BqByR74Uor .cluster-label text{fill:#333;}#mermaid-svg-xWqqZ9BqByR74Uor .cluster-label span{color:#333;}#mermaid-svg-xWqqZ9BqByR74Uor .cluster-label span p{background-color:transparent;}#mermaid-svg-xWqqZ9BqByR74Uor .label text,#mermaid-svg-xWqqZ9BqByR74Uor span{fill:#333;color:#333;}#mermaid-svg-xWqqZ9BqByR74Uor .node rect,#mermaid-svg-xWqqZ9BqByR74Uor .node circle,#mermaid-svg-xWqqZ9BqByR74Uor .node ellipse,#mermaid-svg-xWqqZ9BqByR74Uor .node polygon,#mermaid-svg-xWqqZ9BqByR74Uor .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-xWqqZ9BqByR74Uor .rough-node .label text,#mermaid-svg-xWqqZ9BqByR74Uor .node .label text,#mermaid-svg-xWqqZ9BqByR74Uor .image-shape .label,#mermaid-svg-xWqqZ9BqByR74Uor .icon-shape .label{text-anchor:middle;}#mermaid-svg-xWqqZ9BqByR74Uor .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-xWqqZ9BqByR74Uor .rough-node .label,#mermaid-svg-xWqqZ9BqByR74Uor .node .label,#mermaid-svg-xWqqZ9BqByR74Uor .image-shape .label,#mermaid-svg-xWqqZ9BqByR74Uor .icon-shape .label{text-align:center;}#mermaid-svg-xWqqZ9BqByR74Uor .node.clickable{cursor:pointer;}#mermaid-svg-xWqqZ9BqByR74Uor .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-xWqqZ9BqByR74Uor .arrowheadPath{fill:#333333;}#mermaid-svg-xWqqZ9BqByR74Uor .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-xWqqZ9BqByR74Uor .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-xWqqZ9BqByR74Uor .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-xWqqZ9BqByR74Uor .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-xWqqZ9BqByR74Uor .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-xWqqZ9BqByR74Uor .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-xWqqZ9BqByR74Uor .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-xWqqZ9BqByR74Uor .cluster text{fill:#333;}#mermaid-svg-xWqqZ9BqByR74Uor .cluster span{color:#333;}#mermaid-svg-xWqqZ9BqByR74Uor div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-xWqqZ9BqByR74Uor .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-xWqqZ9BqByR74Uor rect.text{fill:none;stroke-width:0;}#mermaid-svg-xWqqZ9BqByR74Uor .icon-shape,#mermaid-svg-xWqqZ9BqByR74Uor .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-xWqqZ9BqByR74Uor .icon-shape p,#mermaid-svg-xWqqZ9BqByR74Uor .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-xWqqZ9BqByR74Uor .icon-shape .label rect,#mermaid-svg-xWqqZ9BqByR74Uor .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-xWqqZ9BqByR74Uor .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-xWqqZ9BqByR74Uor .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-xWqqZ9BqByR74Uor :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u4e09\u79cd\u9519\u4e71\u59ff\u6001<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u59ff\u6001\u4e00&#xff1a;\u4f2a\u52a8\u6001\u8ba1\u7b97<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u59ff\u6001\u4e8c&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6 &#043; \u6587\u672c\u7f29\u653e<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u59ff\u6001\u4e09&#xff1a;\u7269\u7406\u50cf\u7d20\u4e0e\u903b\u8f91\u50cf\u7d20\u6df7\u6dc6<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>screenHeight \/ 3.55<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u53ea\u6539\u53d8\u6570\u503c\u6765\u6e90\u4e0d\u6539\u53d8\u8bbe\u8ba1\u8bed\u4e49<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5c0f\u5c4f\u4e0a\u4ecd\u7136\u9519\u4f4d<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>SizedBox(height: 100)<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>TextScaler \u653e\u5927\u6587\u672c<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6587\u5b57\u6491\u7834\u5bb9\u5668\u6309\u94ae\u88ab\u63a8\u51fa\u5c4f\u5e55<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>Border.all(width: 1)<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5206\u6570 DPR \u4e0b\u7269\u7406\u50cf\u7d20\u975e\u6574\u6570<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u8fb9\u6846\u6a21\u7cca\u6216\u6d88\u5931<\/p>\n<p><\/span><\/p>\n<h3>\u4e8c\u3001\u6839\u56e0\u5256\u6790&#xff1a;\u786c\u7f16\u7801\u5c3a\u5bf8\u662f\u5728\u7528\u201c\u6570\u503c\u786e\u5b9a\u6027\u201d\u66ff\u4ee3\u201c\u7ea6\u675f\u534f\u5546\u201d<\/h3>\n<h4>2.1 Flutter \u7684\u5c3a\u5bf8\u4e0d\u662f\u201c\u88ab\u8bbe\u5b9a\u201d\u7684&#xff0c;\u800c\u662f\u201c\u88ab\u534f\u5546\u201d\u7684<\/h4>\n<p>\u7b2c8\u8bfe\u5df2\u7ecf\u5efa\u7acb\u4e86 Flutter \u5e03\u5c40\u7684\u94c1\u5f8b&#xff1a;\u201c\u7ea6\u675f\u5411\u4e0b\u4f20\u9012&#xff0c;\u5c3a\u5bf8\u5411\u4e0a\u6c47\u62a5&#xff0c;\u7236\u7ea7\u51b3\u5b9a\u4f4d\u7f6e\u201d\u3002\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u672c\u8d28&#xff0c;\u662f\u5728\u534f\u5546\u5f00\u59cb\u4e4b\u524d\u5c31\u5355\u65b9\u9762\u5ba3\u5e03\u4e86\u534f\u5546\u7684\u7ed3\u679c\u3002SizedBox(width: 100) \u544a\u8bc9\u7236\u7ea7\u201c\u6211\u8981 100 \u903b\u8f91\u50cf\u7d20\u5bbd\u201d&#xff0c;\u5b83\u4e0d\u8be2\u95ee\u7236\u7ea7\u6709\u591a\u5c11\u7a7a\u95f4&#xff0c;\u4e0d\u8be2\u95ee\u5b50\u7ea7\u7684\u5185\u5bb9\u9700\u8981\u591a\u5c11\u7a7a\u95f4&#xff0c;\u4e5f\u4e0d\u8be2\u95ee\u5f53\u524d\u7684\u5b57\u4f53\u7f29\u653e\u662f\u591a\u5c11\u3002\u5f53\u7236\u7ea7\u7684\u7ea6\u675f\u3001\u5b50\u7ea7\u7684\u5185\u5bb9\u6216\u8fd0\u884c\u65f6\u7684\u6587\u672c\u7f29\u653e\u4e0e\u8fd9\u4e2a\u9884\u8bbe\u7684\u6570\u503c\u4e0d\u4e00\u81f4\u65f6&#xff0c;\u534f\u5546\u5c31\u5931\u8d25\u4e86\u3002<\/p>\n<p>\u8fd9\u79cd\u201c\u5355\u65b9\u9762\u5ba3\u5e03\u201d\u5728\u4e24\u79cd\u60c5\u51b5\u4e0b\u662f\u5b89\u5168\u7684&#xff1a;\u7236\u7ea7\u7684\u7ea6\u675f\u4fdd\u8bc1\u8db3\u591f\u5bb9\u7eb3\u8fd9\u4e2a\u6570\u503c&#xff0c;\u5e76\u4e14\u5b50\u7ea7\u7684\u5185\u5bb9\u4fdd\u8bc1\u4e0d\u4f1a\u8d85\u8fc7\u8fd9\u4e2a\u6570\u503c\u3002\u4f46\u5728\u591a\u8bbe\u5907\u3001\u591a\u8bed\u8a00\u3001\u591a\u65e0\u969c\u788d\u8bbe\u7f6e\u7684\u79fb\u52a8\u5e94\u7528\u4e2d&#xff0c;\u8fd9\u4e24\u4e2a\u201c\u4fdd\u8bc1\u201d\u51e0\u4e4e\u603b\u662f\u65e0\u6cd5\u540c\u65f6\u6210\u7acb\u3002GitHub issue #616 \u7cfb\u7edf\u6027\u5730\u5217\u51fa\u4e86\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u516d\u9879\u5371\u5bb3&#xff0c;\u5176\u4e2d\u4e0e\u5e03\u5c40\u76f4\u63a5\u76f8\u5173\u7684\u4e09\u6761\u662f&#xff1a;\u4e0d\u54cd\u5e94\u4e0d\u540c\u7684\u5c4f\u5e55\u5c3a\u5bf8\u6216\u65b9\u5411&#xff1b;\u5728\u4e0d\u540c\u5c4f\u5e55\u5c3a\u5bf8\u4e0a\u9020\u6210\u4e0d\u4e00\u81f4\u7684 UI&#xff1b;\u5f53\u5185\u5bb9\u52a8\u6001\u53d8\u5316&#xff08;\u672c\u5730\u5316\u3001\u5b57\u4f53\u7f29\u653e\u3001\u6570\u636e\u957f\u5ea6\u53d8\u5316&#xff09;\u65f6\u7834\u574f\u5e03\u5c40\u3002<\/p>\n<h4>2.2 \u903b\u8f91\u50cf\u7d20\u662f\u201c\u89c6\u89c9\u5c3a\u5bf8\u201d&#xff0c;\u4e0d\u662f\u201c\u7269\u7406\u5c3a\u5bf8\u201d<\/h4>\n<p>MediaQueryData.size \u8fd4\u56de\u7684\u662f\u903b\u8f91\u50cf\u7d20\u5c3a\u5bf8&#xff0c;\u5b98\u65b9\u5b9a\u4e49\u662f&#xff1a;\u201cLogical pixels are roughly the same visual size across devices\u201d\u3002\u8fd9\u610f\u5473\u7740 width: 100 \u5728\u624b\u673a\u3001\u5e73\u677f\u3001\u684c\u9762\u663e\u793a\u5668\u4e0a\u5927\u81f4\u770b\u8d77\u6765\u4e00\u6837\u5927\u2014\u2014\u8fd9\u662f\u903b\u8f91\u50cf\u7d20\u8bbe\u8ba1\u7684\u521d\u8877&#xff0c;\u4e5f\u662f Flutter \u8de8\u8bbe\u5907\u4e00\u81f4\u6027\u7684\u57fa\u7840\u3002<\/p>\n<p>\u4f46\u201c\u5927\u81f4\u4e00\u6837\u5927\u201d\u4e0d\u7b49\u4e8e\u201c\u5728\u5e03\u5c40\u4e2d\u5360\u636e\u76f8\u540c\u7684\u6bd4\u4f8b\u201d\u3002100 \u903b\u8f91\u50cf\u7d20\u5728\u4e00\u4e2a 320 \u903b\u8f91\u50cf\u7d20\u5bbd\u7684\u5c0f\u5c4f\u4e0a\u5360 31%&#xff0c;\u5728\u4e00\u4e2a 1024 \u903b\u8f91\u50cf\u7d20\u5bbd\u7684\u5e73\u677f\u4e0a\u5360\u4e0d\u5230 10%\u3002\u4e00\u4e2a\u5728\u624b\u673a\u4e0a\u201c\u521a\u597d\u201d\u7684\u56fa\u5b9a\u5bbd\u5ea6&#xff0c;\u5728\u5e73\u677f\u4e0a\u53ef\u80fd\u663e\u5f97\u6781\u5176\u72ed\u7a84&#xff0c;\u5728\u684c\u9762\u7a97\u53e3\u4e0a\u53ef\u80fd\u88ab\u538b\u7f29\u5230\u4e0d\u53ef\u8bfb\u3002\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u95ee\u9898\u4e0d\u662f\u201c\u903b\u8f91\u50cf\u7d20\u4e0d\u5bf9\u201d&#xff0c;\u800c\u662f\u903b\u8f91\u50cf\u7d20\u7684\u6570\u503c\u4e0d\u643a\u5e26\u6bd4\u4f8b\u4fe1\u606f&#xff0c;\u800c\u5e03\u5c40\u5f80\u5f80\u9700\u8981\u6bd4\u4f8b\u3002<\/p>\n<p>MediaQuery.sizeOf \u8fd4\u56de\u7684\u662f\u5e94\u7528\u6574\u4e2a\u5c4f\u5e55\u7684\u5f53\u524d\u5c3a\u5bf8&#xff0c;\u800c\u4e0d\u662f\u5355\u4e2a Widget \u7684\u53ef\u7528\u7a7a\u95f4\u3002\u5982\u679c\u5e94\u7528\u8fd0\u884c\u5728\u684c\u9762\u4e0a\u7684\u4e00\u4e2a\u5c0f\u7a97\u53e3\u4e2d&#xff0c;MediaQuery.sizeOf \u8fd4\u56de\u7684\u662f\u7a97\u53e3\u5c3a\u5bf8&#xff0c;\u800c\u4e0d\u662f\u7269\u7406\u5c4f\u5e55\u5c3a\u5bf8&#xff1b;\u4f46\u5982\u679c\u5e94\u7528\u5728\u4e00\u4e2a\u5206\u5c4f\u5e73\u677f\u7684\u4e00\u4fa7&#xff0c;\u5b83\u8fd4\u56de\u7684\u662f\u4e00\u4fa7\u533a\u57df\u7684\u5c3a\u5bf8\u3002\u7528 MediaQuery.sizeOf(context).width * 0.5 \u6765\u8ba1\u7b97\u5bbd\u5ea6&#xff0c;\u5f97\u5230\u7684\u662f\u5e94\u7528\u7a97\u53e3\u4e00\u534a\u7684\u5bbd\u5ea6&#xff0c;\u4e0d\u4e00\u5b9a\u7b49\u4e8e\u5f53\u524d Widget \u53ef\u7528\u7a7a\u95f4\u7684\u4e00\u534a\u3002\u5f53 Widget \u4f4d\u4e8e\u4e00\u4e2a Padding\u3001\u4e00\u4e2a Row \u7684 Expanded \u6216\u4e00\u4e2a Drawer \u4e2d\u65f6&#xff0c;\u5b83\u7684\u53ef\u7528\u7a7a\u95f4\u8fdc\u5c0f\u4e8e MediaQuery.sizeOf \u8fd4\u56de\u7684\u503c\u3002\u8fd9\u662f\u201c\u4f2a\u52a8\u6001\u8ba1\u7b97\u201d\u5728\u590d\u6742\u5d4c\u5957\u4e2d\u5931\u6548\u7684\u53e6\u4e00\u4e2a\u539f\u56e0\u3002<\/p>\n<h4>2.3 \u6587\u672c\u7f29\u653e\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u3001\u4e0e\u5c4f\u5e55\u5c3a\u5bf8\u6b63\u4ea4\u7684\u7ef4\u5ea6<\/h4>\n<p>\u5f00\u53d1\u8005\u901a\u5e38\u4f1a\u628a\u201c\u9002\u914d\u201d\u7406\u89e3\u4e3a\u201c\u5904\u7406\u4e0d\u540c\u5c4f\u5e55\u5c3a\u5bf8\u201d&#xff0c;\u4f46 TextScaler \u5f15\u5165\u4e86\u4e00\u4e2a\u4e0e\u5c4f\u5e55\u5c3a\u5bf8\u65e0\u5173\u7684\u7ef4\u5ea6\u3002\u4e00\u4e2a 6.7 \u82f1\u5bf8\u7684\u5927\u5c4f\u624b\u673a&#xff0c;\u5982\u679c\u7528\u6237\u5c06\u7cfb\u7edf\u5b57\u4f53\u8bbe\u7f6e\u4e3a 200%&#xff0c;\u5176\u6587\u672c\u5360\u7528\u7684\u7a7a\u95f4\u53ef\u80fd\u8d85\u8fc7\u4e00\u4e2a 10 \u82f1\u5bf8\u5e73\u677f\u5728 100% \u5b57\u4f53\u4e0b\u7684\u6587\u672c\u5360\u7528\u7a7a\u95f4\u3002TextScaler.linear(1.5) \u548c TextScaler.linear(2.0) \u662f Android \u548c iOS \u8f85\u52a9\u529f\u80fd\u8bbe\u7f6e\u4e2d\u7684\u5e38\u89c1\u503c\u3002<\/p>\n<p>\u8fd9\u610f\u5473\u7740&#xff1a;\u56fa\u5b9a\u5c3a\u5bf8\u7684\u5bb9\u5668\u4e0d\u4ec5\u8981\u80fd\u5728\u4e0d\u540c\u5c4f\u5e55\u5c3a\u5bf8\u4e0b\u5bb9\u7eb3\u5185\u5bb9&#xff0c;\u8fd8\u8981\u80fd\u5728\u4e0d\u540c\u7684\u6587\u672c\u7f29\u653e\u56e0\u5b50\u4e0b\u5bb9\u7eb3\u5185\u5bb9\u3002\u4e24\u4e2a\u7ef4\u5ea6\u662f\u6b63\u4ea4\u7684&#xff1a;\u4e00\u4e2a\u5e03\u5c40\u53ef\u80fd\u5728\u5c4f\u5e55\u5c3a\u5bf8\u7ef4\u5ea6\u4e0a\u201c\u54cd\u5e94\u5f0f\u201d\u5730\u4f7f\u7528\u4e86 MediaQuery \u767e\u5206\u6bd4&#xff0c;\u4f46\u5728\u6587\u672c\u7f29\u653e\u7ef4\u5ea6\u4e0a\u4ecd\u7136\u662f\u201c\u786c\u7f16\u7801\u201d\u7684\u2014\u2014\u56e0\u4e3a\u5b83\u9884\u8bbe\u4e86\u6587\u672c\u7684\u9ad8\u5ea6\u3002flutter-skills \u7684\u89c4\u5219\u662f\u7cbe\u786e\u7684&#xff1a;\u201cAvoid hardcoded container heights around text; prefer flexible or scrollable containers\u201d\u3002<\/p>\n<h4>2.4 \u201c\u56fa\u5b9a\u5c3a\u5bf8\u201d\u5728\u8bed\u4e49\u4e0a\u53ef\u80fd\u662f\u6b63\u786e\u7684&#xff0c;\u4f46\u201c\u56fa\u5b9a\u7684\u6570\u503c\u201d\u51e0\u4e4e\u4ece\u4e0d\u6b63\u786e<\/h4>\n<p>\u9700\u8981\u505a\u4e00\u4e2a\u91cd\u8981\u7684\u533a\u5206&#xff1a;\u56fa\u5b9a\u5c3a\u5bf8\u4f5c\u4e3a\u8bbe\u8ba1\u610f\u56fe\u662f\u5408\u7406\u7684\u2014\u2014\u4e00\u4e2a\u56fe\u6807\u6309\u94ae\u7684\u89e6\u6478\u76ee\u6807\u5e94\u8be5\u662f 48 \u903b\u8f91\u50cf\u7d20&#xff08;Material Design \u7684\u6700\u5c0f\u89e6\u6478\u76ee\u6807&#xff09;&#xff0c;\u4e00\u4e2a\u5934\u50cf\u53ef\u80fd\u5e94\u8be5\u662f 40\u00d740&#xff0c;\u4e00\u4e2a\u5206\u5272\u7ebf\u53ef\u80fd\u662f 1 \u903b\u8f91\u50cf\u7d20\u3002\u8fd9\u4e9b\u662f\u6709\u8bed\u4e49\u7684\u56fa\u5b9a\u5c3a\u5bf8&#xff0c;\u5b83\u4eec\u4e0d\u968f\u5c4f\u5e55\u6216\u5b57\u4f53\u53d8\u5316&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u7684\u201c\u56fa\u5b9a\u201d\u672c\u8eab\u5c31\u662f\u8bbe\u8ba1\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p>\u786c\u7f16\u7801\u7684\u7f6a\u8fc7\u4e0d\u662f\u201c\u4f7f\u7528\u4e86\u56fa\u5b9a\u5c3a\u5bf8\u201d&#xff0c;\u800c\u662f\u628a\u56fa\u5b9a\u5c3a\u5bf8\u7684\u6570\u503c\u5199\u6b7b\u5728\u4e00\u4e2a\u4e0d\u643a\u5e26\u8bed\u4e49\u7684\u4f4d\u7f6e\u3002width: 100 \u6ca1\u6709\u544a\u8bc9\u4efb\u4f55\u4eba\u201c\u8fd9\u4e2a 100 \u662f\u56e0\u4e3a\u5b83\u662f\u4e00\u4e2a\u89e6\u6478\u76ee\u6807&#xff0c;\u8fd8\u662f\u56e0\u4e3a\u5b83\u662f\u4e00\u4e2a\u56fe\u6807&#xff0c;\u8fd8\u662f\u56e0\u4e3a\u5b83\u662f\u4e00\u4e2a\u5e03\u5c40\u4e2d\u7684\u5f39\u6027\u95f4\u9694\u201d\u3002\u5f53\u8bbe\u8ba1\u53d8\u66f4\u3001\u8bbe\u5907\u53d8\u5316\u6216\u5b57\u4f53\u7f29\u653e\u65f6&#xff0c;\u6ca1\u6709\u4efb\u4f55\u673a\u5236\u77e5\u9053\u8fd9\u4e2a 100 \u5e94\u8be5\u4fdd\u6301\u4e0d\u53d8&#xff0c;\u8fd8\u662f\u5e94\u8be5\u88ab\u8c03\u6574\u3002\u4e00\u4e2a\u6709\u8bed\u4e49\u7684\u56fa\u5b9a\u5c3a\u5bf8\u5e94\u8be5\u88ab\u8868\u8fbe\u4e3a\u5177\u540d\u7684\u5e38\u91cf&#xff08;kMinTouchTargetSize&#xff09;\u3001\u88ab ConstrainedBox \u7684\u7ea6\u675f\u5305\u88f9\u3001\u6216\u8005\u88ab Flexible\/Expanded \u7684\u5f39\u6027\u8bed\u4e49\u66ff\u4ee3&#xff0c;\u800c\u4e0d\u662f\u4e00\u4e2a\u6563\u843d\u5728 build \u4e2d\u7684\u5b57\u9762\u91cf\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u6839\u56e0\u5256\u6790\u7684\u5b8c\u6574\u903b\u8f91\u94fe&#xff1a;<\/p>\n<p>  #mermaid-svg-44nqgCD6ZFOG7B4K{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-44nqgCD6ZFOG7B4K .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-44nqgCD6ZFOG7B4K .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-44nqgCD6ZFOG7B4K .error-icon{fill:#552222;}#mermaid-svg-44nqgCD6ZFOG7B4K .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-44nqgCD6ZFOG7B4K .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-44nqgCD6ZFOG7B4K .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-44nqgCD6ZFOG7B4K .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-44nqgCD6ZFOG7B4K .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-44nqgCD6ZFOG7B4K .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-44nqgCD6ZFOG7B4K .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-44nqgCD6ZFOG7B4K .marker{fill:#333333;stroke:#333333;}#mermaid-svg-44nqgCD6ZFOG7B4K .marker.cross{stroke:#333333;}#mermaid-svg-44nqgCD6ZFOG7B4K svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-44nqgCD6ZFOG7B4K p{margin:0;}#mermaid-svg-44nqgCD6ZFOG7B4K .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-44nqgCD6ZFOG7B4K .cluster-label text{fill:#333;}#mermaid-svg-44nqgCD6ZFOG7B4K .cluster-label span{color:#333;}#mermaid-svg-44nqgCD6ZFOG7B4K .cluster-label span p{background-color:transparent;}#mermaid-svg-44nqgCD6ZFOG7B4K .label text,#mermaid-svg-44nqgCD6ZFOG7B4K span{fill:#333;color:#333;}#mermaid-svg-44nqgCD6ZFOG7B4K .node rect,#mermaid-svg-44nqgCD6ZFOG7B4K .node circle,#mermaid-svg-44nqgCD6ZFOG7B4K .node ellipse,#mermaid-svg-44nqgCD6ZFOG7B4K .node polygon,#mermaid-svg-44nqgCD6ZFOG7B4K .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-44nqgCD6ZFOG7B4K .rough-node .label text,#mermaid-svg-44nqgCD6ZFOG7B4K .node .label text,#mermaid-svg-44nqgCD6ZFOG7B4K .image-shape .label,#mermaid-svg-44nqgCD6ZFOG7B4K .icon-shape .label{text-anchor:middle;}#mermaid-svg-44nqgCD6ZFOG7B4K .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-44nqgCD6ZFOG7B4K .rough-node .label,#mermaid-svg-44nqgCD6ZFOG7B4K .node .label,#mermaid-svg-44nqgCD6ZFOG7B4K .image-shape .label,#mermaid-svg-44nqgCD6ZFOG7B4K .icon-shape .label{text-align:center;}#mermaid-svg-44nqgCD6ZFOG7B4K .node.clickable{cursor:pointer;}#mermaid-svg-44nqgCD6ZFOG7B4K .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-44nqgCD6ZFOG7B4K .arrowheadPath{fill:#333333;}#mermaid-svg-44nqgCD6ZFOG7B4K .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-44nqgCD6ZFOG7B4K .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-44nqgCD6ZFOG7B4K .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-44nqgCD6ZFOG7B4K .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-44nqgCD6ZFOG7B4K .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-44nqgCD6ZFOG7B4K .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-44nqgCD6ZFOG7B4K .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-44nqgCD6ZFOG7B4K .cluster text{fill:#333;}#mermaid-svg-44nqgCD6ZFOG7B4K .cluster span{color:#333;}#mermaid-svg-44nqgCD6ZFOG7B4K div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-44nqgCD6ZFOG7B4K .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-44nqgCD6ZFOG7B4K rect.text{fill:none;stroke-width:0;}#mermaid-svg-44nqgCD6ZFOG7B4K .icon-shape,#mermaid-svg-44nqgCD6ZFOG7B4K .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-44nqgCD6ZFOG7B4K .icon-shape p,#mermaid-svg-44nqgCD6ZFOG7B4K .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-44nqgCD6ZFOG7B4K .icon-shape .label rect,#mermaid-svg-44nqgCD6ZFOG7B4K .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-44nqgCD6ZFOG7B4K .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-44nqgCD6ZFOG7B4K .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-44nqgCD6ZFOG7B4K :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u786c\u7f16\u7801\u5c3a\u5bf8<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7528\u6570\u503c\u786e\u5b9a\u6027\u66ff\u4ee3\u7ea6\u675f\u534f\u5546<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5355\u65b9\u9762\u5ba3\u5e03\u534f\u5546\u7ed3\u679c<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7236\u7ea7\u7ea6\u675f\u4e0d\u8db3<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5b50\u7ea7\u5185\u5bb9\u8d85\u9650<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6587\u672c\u7f29\u653e\u53d8\u5316<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5e03\u5c40\u9519\u4e71<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u903b\u8f91\u50cf\u7d20\u2260\u7269\u7406\u50cf\u7d20<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4e0d\u643a\u5e26\u6bd4\u4f8b\u4fe1\u606f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6587\u672c\u7f29\u653e\u662f\u6b63\u4ea4\u7ef4\u5ea6<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u56fa\u5b9a\u9ad8\u5ea6\u5bb9\u5668\u65e0\u6cd5\u5bb9\u7eb3<\/p>\n<p><\/span><\/p>\n<h3>\u4e09\u3001\u7ecf\u5178\u6545\u969c\u6a21\u5f0f\u4e0e\u6df1\u5165\u6848\u4f8b<\/h3>\n<h4>\u6a21\u5f0f\u4e00&#xff1a;screen_utils &#043; Figma \u56fa\u5b9a\u8bbe\u8ba1\u7a3f\u2014\u2014\u5c0f\u5c4f\u4e0a\u7684\u201c\u6bd4\u4f8b\u7f29\u653e\u201d\u5931\u6548<\/h4>\n<p>\u4e00\u4e2a\u5f00\u53d1\u8005\u4f7f\u7528 flutter_screenutil&#xff0c;\u4ee5 Figma \u8bbe\u8ba1\u7a3f\u7684 430\u00d7932 \u4e3a\u57fa\u51c6&#xff0c;\u901a\u8fc7 .w\u3001.h\u3001.sp \u6269\u5c55\u6765\u201c\u7b49\u6bd4\u7f29\u653e\u201d\u6240\u6709\u5c3a\u5bf8\u3002\u5728\u63a5\u8fd1\u8bbe\u8ba1\u7a3f\u5c3a\u5bf8\u7684\u8bbe\u5907\u4e0a&#xff0c;\u5e03\u5c40\u4e0e\u8bbe\u8ba1\u7a3f\u4e00\u81f4\u3002\u5728\u8f83\u5c0f\u7684\u624b\u673a&#xff08;\u4f8b\u5982 360 \u903b\u8f91\u50cf\u7d20\u5bbd&#xff09;\u4e0a&#xff0c;\u5e03\u5c40\u65ad\u88c2&#xff0c;\u6309\u94ae\u7684\u56fa\u5b9a\u9ad8\u5ea6\u5728\u4e0d\u540c\u9875\u9762\u4e4b\u95f4\u53d8\u5f97\u4e0d\u4e00\u81f4\u3002<\/p>\n<p>screen_utils \u7684\u6838\u5fc3\u673a\u5236\u662f&#xff1a;\u5c06\u6240\u6709\u5c3a\u5bf8\u4e58\u4ee5\u4e00\u4e2a\u57fa\u4e8e\u8bbe\u8ba1\u7a3f\u5bbd\u5ea6\u548c\u8bbe\u5907\u5bbd\u5ea6\u7684\u7f29\u653e\u56e0\u5b50\u3002\u5b83\u5728\u201c\u8bbe\u5907\u5bbd\u5ea6\u4e0e\u8bbe\u8ba1\u7a3f\u5bbd\u5ea6\u63a5\u8fd1\u201d\u65f6\u8868\u73b0\u826f\u597d&#xff0c;\u4f46\u5b83\u7684\u7f29\u653e\u662f\u7ebf\u6027\u6bd4\u4f8b\u7f29\u653e&#xff0c;\u800c\u5e03\u5c40\u7684\u7ea6\u675f\u534f\u5546\u662f\u975e\u7ebf\u6027\u7684\u3002\u4e00\u4e2a 48 \u903b\u8f91\u50cf\u7d20\u9ad8\u7684\u6309\u94ae&#xff0c;\u5728 360 \u5bbd\u7684\u8bbe\u5907\u4e0a\u88ab\u7f29\u653e\u4e3a 48 * (360\/430) \u2248 40.2&#xff0c;\u4f46\u6309\u94ae\u5185\u90e8\u7684\u6587\u672c\u5e76\u4e0d\u4e00\u5b9a\u6309\u76f8\u540c\u7684\u6bd4\u4f8b\u7f29\u653e&#xff08;.sp \u6709\u72ec\u7acb\u7684\u5b57\u4f53\u7f29\u653e\u903b\u8f91&#xff09;&#xff0c;Row \u4e2d\u7684\u56fe\u6807\u548c\u6587\u672c\u7684\u5bbd\u5ea6\u4e5f\u4e0d\u4e00\u5b9a\u6309\u76f8\u540c\u7684\u6bd4\u4f8b\u53d8\u5316\u3002\u7ed3\u679c\u662f\u4e00\u4e2a\u201c\u770b\u8d77\u6765\u88ab\u7f29\u653e\u4e86&#xff0c;\u4f46\u5185\u90e8\u5143\u7d20\u4e4b\u95f4\u7684\u6bd4\u4f8b\u5173\u7cfb\u5df2\u7ecf\u53d8\u4e86\u201d\u7684\u5e03\u5c40\u3002<\/p>\n<p>\u66f4\u6839\u672c\u7684\u95ee\u9898\u662f&#xff1a;screen_utils \u628a\u201c\u54cd\u5e94\u5f0f\u201d\u7b80\u5316\u4e3a\u201c\u6309\u8bbe\u8ba1\u7a3f\u7b49\u6bd4\u7f29\u653e\u201d&#xff0c;\u800c\u771f\u6b63\u7684\u54cd\u5e94\u5f0f\u9700\u8981\u6839\u636e\u53ef\u7528\u7a7a\u95f4\u548c\u5185\u5bb9\u6765\u91cd\u65b0\u5b89\u6392\u5e03\u5c40&#xff0c;\u800c\u4e0d\u4ec5\u4ec5\u662f\u7f29\u653e\u6570\u503c\u3002Latenode \u793e\u533a\u7684\u56de\u7b54\u5bf9\u6b64\u7684\u603b\u7ed3\u662f\u76f4\u63a5\u7684&#xff1a;\u201cThe problem isn\u2019t screen_utils &#8211; you\u2019re treating responsive design like a Flutter issue when it\u2019s really a workflow issue\u201d\u3002screen_utils \u9002\u5408\u201c\u8bbe\u8ba1\u7a3f\u5c31\u662f\u76ee\u6807\u5e03\u5c40&#xff0c;\u53ea\u9700\u8981\u5728\u4e0d\u540c\u5bc6\u5ea6\u4e0a\u4fdd\u6301\u4e00\u81f4\u89c6\u89c9\u6bd4\u4f8b\u201d\u7684\u573a\u666f&#xff1b;\u5f53\u8bbe\u8ba1\u610f\u56fe\u9700\u8981\u5728\u4e0d\u540c\u5c3a\u5bf8\u4e0a\u6539\u53d8\u5e03\u5c40\u7ed3\u6784&#xff08;\u4f8b\u5982\u5c0f\u5c4f\u5355\u5217\u3001\u5927\u5c4f\u591a\u5217&#xff09;\u65f6&#xff0c;\u7b49\u6bd4\u7f29\u653e\u65e0\u6cd5\u8868\u8fbe\u8fd9\u79cd\u610f\u56fe\u3002<\/p>\n<h4>\u6a21\u5f0f\u4e8c&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6\u6587\u672c\u5bb9\u5668\u7684\u201c\u7ea7\u8054\u5d29\u6e83\u201d\u2014\u2014\u4ece\u88c1\u526a\u5230\u5217\u8868\u8df3\u52a8<\/h4>\n<p>\u4e00\u4e2a ListView \u7684 itemExtent \u88ab\u8bbe\u7f6e\u4e3a 80 \u903b\u8f91\u50cf\u7d20&#xff0c;\u6bcf\u4e2a\u5217\u8868\u9879\u5305\u542b\u4e00\u4e2a\u6807\u9898\u548c\u4e00\u4e2a\u53ef\u6362\u884c\u7684\u526f\u6807\u9898\u3002\u5728\u9ed8\u8ba4\u5b57\u4f53\u4e0b&#xff0c;\u5217\u8868\u6eda\u52a8\u6d41\u7545\u3002\u7528\u6237\u5c06\u7cfb\u7edf\u5b57\u4f53\u653e\u5927\u5230 150% \u540e&#xff0c;\u526f\u6807\u9898\u6362\u884c\u6210\u4e24\u884c&#xff0c;\u603b\u6587\u672c\u9ad8\u5ea6\u8d85\u8fc7 80 \u50cf\u7d20&#xff0c;\u6587\u672c\u88ab\u88c1\u526a&#xff1b;\u540c\u65f6&#xff0c;\u7531\u4e8e itemExtent \u56fa\u5b9a\u4e3a 80&#xff0c;\u5217\u8868\u9879\u7684\u5185\u5bb9\u6ea2\u51fa\u4f46\u5217\u8868\u7684\u6eda\u52a8\u4f4d\u7f6e\u8ba1\u7b97\u6ca1\u6709\u53d8\u5316&#xff0c;\u89c6\u89c9\u4e0a\u8868\u73b0\u4e3a\u5217\u8868\u8df3\u52a8\u548c\u5185\u5bb9\u88ab\u622a\u65ad\u3002<\/p>\n<p>\u8fd9\u4e2a\u6a21\u5f0f\u7684\u6545\u969c\u94fe\u6bd4\u5355\u4e2a\u5bb9\u5668\u6ea2\u51fa\u66f4\u957f&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6\u4e0d\u4ec5\u5f71\u54cd\u5355\u4e2a Widget \u7684\u5185\u90e8\u5e03\u5c40&#xff0c;\u8fd8\u4f1a\u5f71\u54cd\u4f9d\u8d56\u8fd9\u4e2a\u9ad8\u5ea6\u7684\u7236\u7ea7\u5e03\u5c40\u903b\u8f91\u3002ListView \u7684 itemExtent \u88ab\u4f18\u5316\u7528\u4e8e\u201c\u6240\u6709\u5217\u8868\u9879\u9ad8\u5ea6\u76f8\u540c\u201d\u7684\u573a\u666f&#xff0c;\u5b83\u8df3\u8fc7\u4e86\u5bf9\u6bcf\u4e2a\u5b50\u9879\u7684\u56fa\u6709\u9ad8\u5ea6\u6d4b\u91cf&#xff0c;\u76f4\u63a5\u6309\u56fa\u5b9a\u503c\u5b89\u6392\u4f4d\u7f6e\u3002\u5f53\u5b50\u9879\u7684\u5b9e\u9645\u5185\u5bb9\u9ad8\u5ea6\u4e0e itemExtent \u4e0d\u5339\u914d\u65f6&#xff0c;\u5e03\u5c40\u7684\u201c\u4f4d\u7f6e\u8ba1\u7b97\u201d\u548c\u201c\u5185\u5bb9\u6e32\u67d3\u201d\u4f7f\u7528\u4e86\u4e0d\u540c\u7684\u5047\u8bbe&#xff0c;\u7ed3\u679c\u662f\u5185\u5bb9\u88ab\u88c1\u526a\u3001\u5217\u8868\u8df3\u52a8&#xff0c;\u6216\u8005\u6eda\u52a8\u6761\u7684\u957f\u5ea6\u4e0e\u5b9e\u9645\u5185\u5bb9\u957f\u5ea6\u4e0d\u4e00\u81f4\u3002<\/p>\n<p>\u7c7b\u4f3c\u7684\u7ea7\u8054\u6548\u5e94\u51fa\u73b0\u5728 GridView \u7684 childAspectRatio\u3001Table \u7684\u56fa\u5b9a\u884c\u9ad8\u3001\u4ee5\u53ca\u4efb\u4f55\u4f9d\u8d56\u201c\u5c3a\u5bf8\u662f\u786e\u5b9a\u503c\u201d\u7684\u7236\u7ea7\u5e03\u5c40\u4e2d\u3002\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u4ee3\u4ef7\u4e0d\u5c40\u9650\u4e8e\u5b83\u6240\u5728\u7684\u90a3\u4e2a Widget&#xff0c;\u5b83\u4f1a\u6cbf\u7740\u5e03\u5c40\u7684\u4f9d\u8d56\u94fe\u5411\u4e0a\u4f20\u64ad\u3002<\/p>\n<h4>\u6a21\u5f0f\u4e09&#xff1a;1px \u8fb9\u6846\u5728\u5206\u6570 DPR \u4e0b\u7684\u6a21\u7cca\u4e0e\u88c1\u526a<\/h4>\n<p>\u4e00\u4e2a\u5f00\u53d1\u8005\u5728 Divider \u6216 Container \u4e0a\u4f7f\u7528 height: 1 \u6216 border: Border.all(width: 1)&#xff0c;\u671f\u671b\u5f97\u5230\u4e00\u6761\u201c\u6e05\u6670\u7684\u7ec6\u7ebf\u201d\u3002\u5728 DPR \u4e3a 2 \u6216 3 \u7684\u8bbe\u5907\u4e0a&#xff0c;1 \u903b\u8f91\u50cf\u7d20\u6620\u5c04\u5230 2 \u6216 3 \u7269\u7406\u50cf\u7d20&#xff0c;\u7ebf\u6761\u6e05\u6670\u4f46\u6bd4\u9884\u671f\u7c97\u3002\u5728 DPR \u4e3a 1.25\u30011.5 \u6216 2.625 \u7684\u8bbe\u5907\u4e0a&#xff0c;1 \u903b\u8f91\u50cf\u7d20\u7684\u7ebf\u6761\u65e0\u6cd5\u7cbe\u786e\u5bf9\u9f50\u5230\u7269\u7406\u50cf\u7d20\u7f51\u683c&#xff0c;\u5f15\u64ce\u7684\u6297\u952f\u9f7f\u5904\u7406\u5bfc\u81f4\u7ebf\u6761\u6a21\u7cca&#xff0c;\u6216\u8005\u5728\u67d0\u4e9b\u8fb9\u7f18\u4e0a\u88ab\u53d6\u6574\u88c1\u526a\u3002<\/p>\n<p>pixel_snap \u5305\u5bf9\u6b64\u7684\u8868\u8ff0\u662f\u7cbe\u786e\u7684&#xff1a;\u201c1px border being blurry at 150% pixel scaling\u201d\u3002\u8fd9\u4e2a\u95ee\u9898\u7684\u6839\u56e0\u662f\u903b\u8f91\u50cf\u7d20\u7684\u6570\u503c\u8868\u8fbe\u4e86\u4e00\u4e2a\u7269\u7406\u50cf\u7d20\u7684\u610f\u56fe&#xff0c;\u4f46\u4e24\u8005\u4e4b\u95f4\u7684\u8f6c\u6362\u4e0d\u662f\u6574\u6570\u3002\u4e00\u4e2a\u201c1 \u7269\u7406\u50cf\u7d20\u201d\u7684\u7ebf\u6761\u5728\u903b\u8f91\u50cf\u7d20\u4e2d\u5e94\u8be5\u8868\u8fbe\u4e3a 1 \/ devicePixelRatio&#xff0c;\u800c\u4e0d\u662f 1\u3002\u5728 DPR \u4e3a 1.25 \u65f6&#xff0c;1 \/ 1.25 &#061; 0.8 \u903b\u8f91\u50cf\u7d20&#xff1b;\u5728 DPR \u4e3a 2.625 \u65f6&#xff0c;1 \/ 2.625 \u2248 0.381 \u903b\u8f91\u50cf\u7d20\u3002\u76f4\u63a5\u5728\u903b\u8f91\u50cf\u7d20\u4e2d\u5199 1&#xff0c;\u5f97\u5230\u7684\u662f\u4e00\u4e2a\u201c1 \u903b\u8f91\u50cf\u7d20\u201d\u7684\u7ebf\u6761&#xff0c;\u5b83\u5728\u5206\u6570 DPR \u4e0b\u7684\u7269\u7406\u5bbd\u5ea6\u4e0d\u662f\u6574\u6570&#xff0c;\u56e0\u6b64\u65e0\u6cd5\u88ab\u6e05\u6670\u5730\u6e32\u67d3\u3002<\/p>\n<h4>\u6a21\u5f0f\u56db&#xff1a;\u6a2a\u7ad6\u5c4f\u5207\u6362\u4e2d\u7684\u56fa\u5b9a\u5c3a\u5bf8\u2014\u2014\u201c\u5728\u7ad6\u5c4f\u80fd\u7528\u7684\u5bbd\u5ea6&#xff0c;\u5728\u6a2a\u5c4f\u53d8\u6210\u4e86\u9ad8\u5ea6\u201d<\/h4>\n<p>\u4e00\u4e2a\u9875\u9762\u5728\u7ad6\u5c4f\u4e0b\u4f7f\u7528 width: 300 \u7684\u4fa7\u8fb9\u680f&#xff0c;\u7ad6\u5c4f\u5bbd\u5ea6\u4e3a 400 \u903b\u8f91\u50cf\u7d20\u65f6&#xff0c;\u4fa7\u8fb9\u680f\u5360\u636e 75% \u7684\u5bbd\u5ea6&#xff0c;\u5185\u5bb9\u533a\u57df\u5f88\u7a84\u4f46\u53ef\u7528\u3002\u65cb\u8f6c\u5230\u6a2a\u5c4f\u540e&#xff0c;\u5c4f\u5e55\u5bbd\u5ea6\u53d8\u4e3a 800 \u903b\u8f91\u50cf\u7d20&#xff0c;width: 300 \u7684\u4fa7\u8fb9\u680f\u53ea\u5360 37.5%&#xff0c;\u89c6\u89c9\u4e0a\u663e\u5f97\u72ed\u7a84&#xff0c;\u800c\u539f\u672c\u5728\u7ad6\u5c4f\u4e0b\u88ab\u538b\u7f29\u7684\u5185\u5bb9\u533a\u57df\u7a81\u7136\u83b7\u5f97\u4e86\u5927\u91cf\u7a7a\u95f4\u3002\u5982\u679c\u5e03\u5c40\u4e2d\u6ca1\u6709\u9488\u5bf9\u65b9\u5411\u53d8\u5316\u7684\u91cd\u65b0\u6392\u5217\u903b\u8f91&#xff0c;\u6a2a\u5c4f\u4e0b\u7684 UI \u53ef\u80fd\u8868\u73b0\u4e3a\u201c\u4fa7\u8fb9\u680f\u8fc7\u7a84\u3001\u5185\u5bb9\u533a\u57df\u8fc7\u5bbd\u201d\u7684\u4e0d\u5e73\u8861&#xff0c;\u6216\u8005\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b&#xff0c;\u56fa\u5b9a\u5c3a\u5bf8\u7684\u603b\u548c\u8d85\u8fc7\u4e86\u6a2a\u5c4f\u7684\u53ef\u7528\u7a7a\u95f4&#xff08;\u4f8b\u5982\u591a\u4e2a\u5e76\u6392\u7684 Container \u5728\u7ad6\u5c4f\u4e0b\u6070\u597d\u653e\u4e0b&#xff0c;\u6a2a\u5c4f\u4e0b\u5bbd\u5ea6\u589e\u52a0\u4f46\u9ad8\u5ea6\u51cf\u5c11&#xff0c;\u5782\u76f4\u65b9\u5411\u7684\u56fa\u5b9a\u9ad8\u5ea6\u603b\u548c\u8d85\u51fa\u4e86\u65b0\u7684\u53ef\u7528\u9ad8\u5ea6&#xff09;\u3002<\/p>\n<p>OrientationBuilder \u7684\u6587\u6863\u660e\u786e\u6307\u51fa&#xff0c;\u5b83\u201c\u901a\u8fc7\u6bd4\u8f83\u7236 widget \u7684\u53ef\u7528\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u6765\u8ba1\u7b97\u5f53\u524d\u7684 Orientation&#xff0c;\u5e76\u5728\u7236\u7a97\u53e3\u5927\u5c0f\u66f4\u6539\u65f6\u91cd\u5efa\u201d\u3002\u8fd9\u610f\u5473\u7740\u65b9\u5411\u53d8\u5316\u672c\u8eab\u4f1a\u89e6\u53d1\u91cd\u5efa&#xff0c;\u4f46\u5982\u679c\u5e03\u5c40\u4e2d\u5168\u662f\u56fa\u5b9a\u5c3a\u5bf8&#xff0c;\u91cd\u5efa\u540e\u7684\u5e03\u5c40\u4ecd\u7136\u4f7f\u7528\u76f8\u540c\u7684\u6570\u503c&#xff0c;\u53ea\u662f\u53ef\u7528\u7a7a\u95f4\u53d8\u4e86\u3002\u65b9\u5411\u53d8\u5316\u7684\u9002\u914d\u9700\u8981\u7684\u662f\u201c\u6839\u636e\u65b0\u7684\u7ea6\u675f\u91cd\u65b0\u5206\u914d\u5c3a\u5bf8\u201d&#xff0c;\u800c\u4e0d\u662f\u201c\u7528\u76f8\u540c\u7684\u56fa\u5b9a\u5c3a\u5bf8\u5728\u65b0\u7a7a\u95f4\u4e2d\u6446\u653e\u201d\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u56db\u79cd\u7ecf\u5178\u6545\u969c\u6a21\u5f0f\u7684\u5bf9\u6bd4\u603b\u89c8&#xff1a;<\/p>\n<p>  #mermaid-svg-kgPi5qViwksiAYeP{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-kgPi5qViwksiAYeP .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-kgPi5qViwksiAYeP .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-kgPi5qViwksiAYeP .error-icon{fill:#552222;}#mermaid-svg-kgPi5qViwksiAYeP .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-kgPi5qViwksiAYeP .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-kgPi5qViwksiAYeP .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-kgPi5qViwksiAYeP .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-kgPi5qViwksiAYeP .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-kgPi5qViwksiAYeP .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-kgPi5qViwksiAYeP .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-kgPi5qViwksiAYeP .marker{fill:#333333;stroke:#333333;}#mermaid-svg-kgPi5qViwksiAYeP .marker.cross{stroke:#333333;}#mermaid-svg-kgPi5qViwksiAYeP svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-kgPi5qViwksiAYeP p{margin:0;}#mermaid-svg-kgPi5qViwksiAYeP .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-kgPi5qViwksiAYeP .cluster-label text{fill:#333;}#mermaid-svg-kgPi5qViwksiAYeP .cluster-label span{color:#333;}#mermaid-svg-kgPi5qViwksiAYeP .cluster-label span p{background-color:transparent;}#mermaid-svg-kgPi5qViwksiAYeP .label text,#mermaid-svg-kgPi5qViwksiAYeP span{fill:#333;color:#333;}#mermaid-svg-kgPi5qViwksiAYeP .node rect,#mermaid-svg-kgPi5qViwksiAYeP .node circle,#mermaid-svg-kgPi5qViwksiAYeP .node ellipse,#mermaid-svg-kgPi5qViwksiAYeP .node polygon,#mermaid-svg-kgPi5qViwksiAYeP .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-kgPi5qViwksiAYeP .rough-node .label text,#mermaid-svg-kgPi5qViwksiAYeP .node .label text,#mermaid-svg-kgPi5qViwksiAYeP .image-shape .label,#mermaid-svg-kgPi5qViwksiAYeP .icon-shape .label{text-anchor:middle;}#mermaid-svg-kgPi5qViwksiAYeP .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-kgPi5qViwksiAYeP .rough-node .label,#mermaid-svg-kgPi5qViwksiAYeP .node .label,#mermaid-svg-kgPi5qViwksiAYeP .image-shape .label,#mermaid-svg-kgPi5qViwksiAYeP .icon-shape .label{text-align:center;}#mermaid-svg-kgPi5qViwksiAYeP .node.clickable{cursor:pointer;}#mermaid-svg-kgPi5qViwksiAYeP .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-kgPi5qViwksiAYeP .arrowheadPath{fill:#333333;}#mermaid-svg-kgPi5qViwksiAYeP .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-kgPi5qViwksiAYeP .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-kgPi5qViwksiAYeP .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-kgPi5qViwksiAYeP .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-kgPi5qViwksiAYeP .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-kgPi5qViwksiAYeP .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-kgPi5qViwksiAYeP .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-kgPi5qViwksiAYeP .cluster text{fill:#333;}#mermaid-svg-kgPi5qViwksiAYeP .cluster span{color:#333;}#mermaid-svg-kgPi5qViwksiAYeP div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-kgPi5qViwksiAYeP .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-kgPi5qViwksiAYeP rect.text{fill:none;stroke-width:0;}#mermaid-svg-kgPi5qViwksiAYeP .icon-shape,#mermaid-svg-kgPi5qViwksiAYeP .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-kgPi5qViwksiAYeP .icon-shape p,#mermaid-svg-kgPi5qViwksiAYeP .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-kgPi5qViwksiAYeP .icon-shape .label rect,#mermaid-svg-kgPi5qViwksiAYeP .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-kgPi5qViwksiAYeP .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-kgPi5qViwksiAYeP .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-kgPi5qViwksiAYeP :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7ecf\u5178\u6545\u969c\u6a21\u5f0f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6a21\u5f0f\u4e00&#xff1a;screen_utils\u7b49\u6bd4\u7f29\u653e\u5931\u6548<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6a21\u5f0f\u4e8c&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6\u7ea7\u8054\u5d29\u6e83<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6a21\u5f0f\u4e09&#xff1a;1px \u8fb9\u6846\u5206\u6570 DPR \u6a21\u7cca<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6a21\u5f0f\u56db&#xff1a;\u6a2a\u7ad6\u5c4f\u5207\u6362\u56fa\u5b9a\u5c3a\u5bf8\u5931\u914d<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7ebf\u6027\u7f29\u653e \u2260 \u975e\u7ebf\u6027\u7ea6\u675f\u534f\u5546<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5185\u90e8\u5143\u7d20\u6bd4\u4f8b\u5173\u7cfb\u6539\u53d8<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>itemExtent \u56fa\u5b9a 80<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6587\u672c\u7f29\u653e\u540e\u9ad8\u5ea6\u8d85\u9650<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u88c1\u526a &#043; \u5217\u8868\u8df3\u52a8<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>1 \u903b\u8f91\u50cf\u7d20 \u2260 \u6574\u6570\u7269\u7406\u50cf\u7d20<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u6297\u952f\u9f7f \/ \u53d6\u6574\u88c1\u526a<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7ad6\u5c4f\u53ef\u7528\u5bbd\u5ea6\u6a2a\u5c4f\u53d8\u6210\u9ad8\u5ea6<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u56fa\u5b9a\u5c3a\u5bf8\u603b\u548c\u8d85\u51fa\u65b0\u7a7a\u95f4<\/p>\n<p><\/span><\/p>\n<h3>\u56db\u3001\u7cfb\u7edf\u6027\u6392\u67e5\u65b9\u6cd5\u8bba<\/h3>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u533a\u5206\u201c\u6709\u8bed\u4e49\u7684\u56fa\u5b9a\u5c3a\u5bf8\u201d\u4e0e\u201c\u6570\u503c\u786c\u7f16\u7801\u201d<\/h4>\n<p>\u5bf9\u4ee3\u7801\u5e93\u4e2d\u7684\u6bcf\u4e00\u5904\u5c3a\u5bf8\u5b57\u9762\u91cf&#xff0c;\u95ee\u4e00\u4e2a\u95ee\u9898&#xff1a;\u8fd9\u4e2a\u6570\u503c\u662f\u5426\u627f\u8f7d\u4e86\u4e00\u4e2a\u4e0d\u968f\u5e03\u5c40\u4e0a\u4e0b\u6587\u53d8\u5316\u7684\u8bbe\u8ba1\u8bed\u4e49&#xff1f; \u4e00\u4e2a 48 \u7684\u89e6\u6478\u76ee\u6807\u3001\u4e00\u4e2a 40\u00d740 \u7684\u5934\u50cf\u3001\u4e00\u4e2a 1 \u903b\u8f91\u50cf\u7d20\u7684\u5206\u5272\u7ebf&#xff0c;\u662f\u6709\u8bed\u4e49\u7684\u56fa\u5b9a\u5c3a\u5bf8\u3002\u4e00\u4e2a 100 \u5bbd\u7684 Container\u3001\u4e00\u4e2a 200 \u9ad8\u7684 SizedBox\u3001\u4e00\u4e2a 16 \u7684 fontSize&#xff08;\u6ca1\u6709\u7ed1\u5b9a\u5230\u5b57\u4f53\u4e3b\u9898&#xff09;&#xff0c;\u662f\u6570\u503c\u786c\u7f16\u7801\u3002\u6392\u67e5\u7684\u8d77\u70b9\u4e0d\u662f\u201c\u5220\u9664\u6240\u6709\u56fa\u5b9a\u5c3a\u5bf8\u201d&#xff0c;\u800c\u662f\u8bc6\u522b\u54ea\u4e9b\u56fa\u5b9a\u5c3a\u5bf8\u662f\u8bbe\u8ba1\u610f\u56fe&#xff0c;\u54ea\u4e9b\u53ea\u662f\u201c\u5728\u5f53\u524d\u8bbe\u5907\u4e0a\u6070\u597d\u80fd\u7528\u201d\u7684\u6570\u503c\u3002\u6709\u8bed\u4e49\u7684\u56fa\u5b9a\u5c3a\u5bf8\u5e94\u8be5\u88ab\u547d\u540d\u4e3a\u5e38\u91cf&#xff08;kAvatarSize\u3001kMinTouchTarget&#xff09;&#xff0c;\u5e76\u63a5\u53d7\u5ba1\u67e5\u4ee5\u786e\u4fdd\u5b83\u4eec\u7684\u8bed\u4e49\u662f\u7a33\u5b9a\u7684&#xff1b;\u6570\u503c\u786c\u7f16\u7801\u5e94\u8be5\u88ab\u66ff\u6362\u4e3a\u57fa\u4e8e\u7ea6\u675f\u6216\u5185\u5bb9\u7684\u5c3a\u5bf8\u7b56\u7565\u3002<\/p>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u5728 DevTools \u4e2d\u68c0\u67e5\u201c\u7ea6\u675f\u201d\u800c\u4e0d\u662f\u201c\u5c3a\u5bf8\u201d<\/h4>\n<p>\u5f53\u5e03\u5c40\u5728\u67d0\u4e2a\u8bbe\u5907\u4e0a\u9519\u4e71\u65f6&#xff0c;\u4e0d\u8981\u53ea\u770b Widget \u7684\u6700\u7ec8\u5c3a\u5bf8&#xff0c;\u8981\u770b\u5b83\u5728\u7ea6\u675f\u94fe\u4e2d\u7684\u4f4d\u7f6e\u3002\u5728 Widget Inspector \u4e2d\u9009\u4e2d\u62a5\u9519\u7684 Widget&#xff0c;\u68c0\u67e5&#xff1a;\u7236\u7ea7\u7ed9\u5b83\u7684\u7ea6\u675f\u662f\u4ec0\u4e48&#xff1f;\u5b83\u6c47\u62a5\u7684\u5c3a\u5bf8\u662f\u591a\u5c11&#xff1f;\u5b83\u7684\u5b50\u7ea7\u7684\u56fa\u6709\u5c3a\u5bf8\u662f\u591a\u5c11&#xff1f; \u5982\u679c\u7236\u7ea7\u7ed9\u51fa\u7684 maxWidth \u662f 360&#xff0c;\u800c Widget \u7684 width \u662f 300&#xff0c;\u90a3\u4e48 Widget \u5360\u636e\u4e86 83% \u7684\u53ef\u7528\u5bbd\u5ea6&#xff1b;\u5982\u679c maxWidth \u662f 800&#xff0c;\u540c\u4e00\u4e2a 300 \u53ea\u5360 37.5%\u3002\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u95ee\u9898\u5f80\u5f80\u4e0d\u662f\u201c\u5c3a\u5bf8\u9519\u4e86\u201d&#xff0c;\u800c\u662f\u201c\u5c3a\u5bf8\u4e0e\u53ef\u7528\u7a7a\u95f4\u7684\u6bd4\u4f8b\u5728\u53d8\u5316\u201d\u3002<\/p>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u5728\u6587\u672c\u7f29\u653e\u4e0b\u505a\u4e13\u9879\u6d4b\u8bd5<\/h4>\n<p>\u5c3a\u5bf8\u786c\u7f16\u7801\u7684\u8bb8\u591a\u6545\u969c\u5728\u9ed8\u8ba4\u5b57\u4f53\u7f29\u653e&#xff08;1.0&#xff09;\u4e0b\u4e0d\u53ef\u89c1\u3002\u6392\u67e5\u65f6\u5e94\u8be5\u81f3\u5c11\u5728 TextScaler.linear(1.5) \u548c TextScaler.linear(2.0) \u4e0b\u91cd\u65b0\u8fd0\u884c\u9875\u9762\u3002flutter-skills \u5efa\u8bae\u4e13\u95e8\u6d4b\u8bd5\u201cEnlarged font scaling (TextScaler.linear(1.5) and TextScaler.linear(2.0))\u201d\u3002\u5728\u6d4b\u8bd5\u4e2d&#xff0c;\u91cd\u70b9\u89c2\u5bdf&#xff1a;\u56fa\u5b9a\u9ad8\u5ea6\u7684\u5bb9\u5668\u662f\u5426\u88c1\u526a\u6587\u672c&#xff1b;\u5e95\u90e8\u6309\u94ae\u662f\u5426\u88ab\u63a8\u51fa\u5c4f\u5e55&#xff1b;Row \u4e2d\u7684\u6587\u672c\u662f\u5426\u6324\u538b\u56fe\u6807&#xff1b;ListView \u7684\u56fa\u5b9a itemExtent \u662f\u5426\u5bfc\u81f4\u8df3\u52a8\u3002<\/p>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u7528 LayoutBuilder \u533a\u5206\u201c\u5c4f\u5e55\u5c3a\u5bf8\u201d\u4e0e\u201c\u5c40\u90e8\u7ea6\u675f\u201d<\/h4>\n<p>\u5982\u679c\u5e03\u5c40\u7684\u9519\u4e71\u4e0e\u201cWidget \u5728\u6811\u4e2d\u7684\u4f4d\u7f6e\u201d\u6709\u5173&#xff08;\u4f8b\u5982\u540c\u6837\u7684\u5361\u7247\u5728\u9875\u9762\u9876\u90e8\u6b63\u5e38&#xff0c;\u5728 Drawer \u4e2d\u9519\u4e71&#xff09;&#xff0c;\u95ee\u9898\u5f88\u53ef\u80fd\u51fa\u5728\u4f7f\u7528\u4e86 MediaQuery.sizeOf \u800c\u4e0d\u662f LayoutBuilder\u3002MediaQuery.sizeOf \u8fd4\u56de\u7684\u662f\u5e94\u7528\u6574\u4e2a\u5c4f\u5e55\u7684\u5c3a\u5bf8&#xff0c;\u800c LayoutBuilder \u8fd4\u56de\u7684\u662f\u7236\u7ea7\u7ed9\u5f53\u524d Widget \u7684\u7ea6\u675f\u3002\u6392\u67e5\u65f6&#xff0c;\u5bf9\u6bcf\u4e00\u4e2a\u4f7f\u7528 MediaQuery.sizeOf \u6765\u8ba1\u7b97\u5c3a\u5bf8\u7684\u4f4d\u7f6e&#xff0c;\u95ee&#xff1a;\u8fd9\u4e2a\u5c3a\u5bf8\u5e94\u8be5\u57fa\u4e8e\u6574\u4e2a\u5c4f\u5e55&#xff0c;\u8fd8\u662f\u57fa\u4e8e\u8fd9\u4e2a Widget \u5b9e\u9645\u53ef\u7528\u7684\u7a7a\u95f4&#xff1f;\u5982\u679c\u7b54\u6848\u662f\u540e\u8005&#xff0c;LayoutBuilder \u662f\u66f4\u7cbe\u786e\u7684\u5de5\u5177\u3002<\/p>\n<h4>\u7b2c\u4e94\u6b65&#xff1a;\u533a\u5206\u201c\u5c3a\u5bf8\u95ee\u9898\u201d\u4e0e\u201c\u5e03\u5c40\u7ed3\u6784\u95ee\u9898\u201d<\/h4>\n<p>\u4e0d\u662f\u6240\u6709\u7684\u9002\u914d\u95ee\u9898\u90fd\u80fd\u901a\u8fc7\u201c\u628a\u56fa\u5b9a\u5c3a\u5bf8\u6362\u6210\u5f39\u6027\u5c3a\u5bf8\u201d\u89e3\u51b3\u3002\u5982\u679c\u4e00\u4e2a\u9875\u9762\u5728\u5e73\u677f\u4e0a\u9700\u8981\u4ece\u5355\u5217\u53d8\u6210\u53cc\u5217&#xff0c;\u5728\u5c0f\u5c4f\u4e0a\u9700\u8981\u4ece\u53cc\u5217\u53d8\u6210\u5355\u5217&#xff0c;\u90a3\u4e48\u95ee\u9898\u7684\u672c\u8d28\u662f\u5e03\u5c40\u7ed3\u6784\u9700\u8981\u6839\u636e\u65ad\u70b9\u5206\u652f&#xff0c;\u800c\u4e0d\u4ec5\u4ec5\u662f\u67d0\u4e2a Widget \u7684\u5c3a\u5bf8\u9700\u8981\u5f39\u6027\u5316\u3002LayoutBuilder \u7684 constraints.maxWidth \u53ef\u4ee5\u7528\u4e8e\u5728\u65ad\u70b9\u5904\u5207\u6362\u5e03\u5c40\u7ed3\u6784&#xff08;\u4f8b\u5982 &lt; 600 \u65f6\u8fd4\u56de\u5355\u5217&#xff0c;&gt;&#061; 600 \u65f6\u8fd4\u56de\u53cc\u5217&#xff09;\u3002\u6392\u67e5\u65f6\u5e94\u8be5\u660e\u786e&#xff1a;\u5f53\u524d\u7684\u95ee\u9898\u662f\u201c\u67d0\u4e2a Widget \u7684\u5c3a\u5bf8\u4e0d\u5339\u914d\u201d&#xff0c;\u8fd8\u662f\u201c\u6574\u4e2a\u5e03\u5c40\u7684\u7ed3\u6784\u4e0d\u5339\u914d\u201d&#xff1f;\u524d\u8005\u7528\u5f39\u6027\u5c3a\u5bf8\u6216\u7ea6\u675f\u4fee\u590d&#xff0c;\u540e\u8005\u7528 LayoutBuilder &#043; \u65ad\u70b9\u5206\u652f\u4fee\u590d\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u7cfb\u7edf\u6027\u6392\u67e5\u65b9\u6cd5\u8bba\u7684\u6d41\u7a0b\u56fe&#xff1a;<\/p>\n<p>  #mermaid-svg-hrTpXKdTKIjB65qq{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-hrTpXKdTKIjB65qq .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-hrTpXKdTKIjB65qq .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-hrTpXKdTKIjB65qq .error-icon{fill:#552222;}#mermaid-svg-hrTpXKdTKIjB65qq .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-hrTpXKdTKIjB65qq .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-hrTpXKdTKIjB65qq .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-hrTpXKdTKIjB65qq .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-hrTpXKdTKIjB65qq .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-hrTpXKdTKIjB65qq .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-hrTpXKdTKIjB65qq .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-hrTpXKdTKIjB65qq .marker{fill:#333333;stroke:#333333;}#mermaid-svg-hrTpXKdTKIjB65qq .marker.cross{stroke:#333333;}#mermaid-svg-hrTpXKdTKIjB65qq svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-hrTpXKdTKIjB65qq p{margin:0;}#mermaid-svg-hrTpXKdTKIjB65qq .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-hrTpXKdTKIjB65qq .cluster-label text{fill:#333;}#mermaid-svg-hrTpXKdTKIjB65qq .cluster-label span{color:#333;}#mermaid-svg-hrTpXKdTKIjB65qq .cluster-label span p{background-color:transparent;}#mermaid-svg-hrTpXKdTKIjB65qq .label text,#mermaid-svg-hrTpXKdTKIjB65qq span{fill:#333;color:#333;}#mermaid-svg-hrTpXKdTKIjB65qq .node rect,#mermaid-svg-hrTpXKdTKIjB65qq .node circle,#mermaid-svg-hrTpXKdTKIjB65qq .node ellipse,#mermaid-svg-hrTpXKdTKIjB65qq .node polygon,#mermaid-svg-hrTpXKdTKIjB65qq .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-hrTpXKdTKIjB65qq .rough-node .label text,#mermaid-svg-hrTpXKdTKIjB65qq .node .label text,#mermaid-svg-hrTpXKdTKIjB65qq .image-shape .label,#mermaid-svg-hrTpXKdTKIjB65qq .icon-shape .label{text-anchor:middle;}#mermaid-svg-hrTpXKdTKIjB65qq .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-hrTpXKdTKIjB65qq .rough-node .label,#mermaid-svg-hrTpXKdTKIjB65qq .node .label,#mermaid-svg-hrTpXKdTKIjB65qq .image-shape .label,#mermaid-svg-hrTpXKdTKIjB65qq .icon-shape .label{text-align:center;}#mermaid-svg-hrTpXKdTKIjB65qq .node.clickable{cursor:pointer;}#mermaid-svg-hrTpXKdTKIjB65qq .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-hrTpXKdTKIjB65qq .arrowheadPath{fill:#333333;}#mermaid-svg-hrTpXKdTKIjB65qq .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-hrTpXKdTKIjB65qq .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-hrTpXKdTKIjB65qq .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-hrTpXKdTKIjB65qq .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-hrTpXKdTKIjB65qq .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-hrTpXKdTKIjB65qq .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-hrTpXKdTKIjB65qq .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-hrTpXKdTKIjB65qq .cluster text{fill:#333;}#mermaid-svg-hrTpXKdTKIjB65qq .cluster span{color:#333;}#mermaid-svg-hrTpXKdTKIjB65qq div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-hrTpXKdTKIjB65qq .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-hrTpXKdTKIjB65qq rect.text{fill:none;stroke-width:0;}#mermaid-svg-hrTpXKdTKIjB65qq .icon-shape,#mermaid-svg-hrTpXKdTKIjB65qq .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-hrTpXKdTKIjB65qq .icon-shape p,#mermaid-svg-hrTpXKdTKIjB65qq .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-hrTpXKdTKIjB65qq .icon-shape .label rect,#mermaid-svg-hrTpXKdTKIjB65qq .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-hrTpXKdTKIjB65qq .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-hrTpXKdTKIjB65qq .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-hrTpXKdTKIjB65qq :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u662f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u5426<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u5c3a\u5bf8\u95ee\u9898<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u7ed3\u6784\u95ee\u9898<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7cfb\u7edf\u6027\u6392\u67e5\u65b9\u6cd5\u8bba<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u4e00\u6b65&#xff1a;\u533a\u5206\u8bed\u4e49\u56fa\u5b9a\u5c3a\u5bf8\u4e0e\u6570\u503c\u786c\u7f16\u7801<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff1a;DevTools \u68c0\u67e5\u7ea6\u675f\u800c\u4e0d\u662f\u5c3a\u5bf8<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u4e09\u6b65&#xff1a;\u6587\u672c\u7f29\u653e\u4e13\u9879\u6d4b\u8bd5TextScaler 1.5 \/ 2.0<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u56db\u6b65&#xff1a;\u95ee\u9898\u4e0e\u4f4d\u7f6e\u6709\u5173&#xff1f;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7528 LayoutBuilder \u533a\u5206\u5c4f\u5e55\u5c3a\u5bf8\u4e0e\u5c40\u90e8\u7ea6\u675f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7ee7\u7eed\u68c0\u67e5<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u4e94\u6b65&#xff1a;\u5c3a\u5bf8\u95ee\u9898\u8fd8\u662f\u7ed3\u6784\u95ee\u9898&#xff1f;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5f39\u6027\u5c3a\u5bf8 \/ \u7ea6\u675f\u4fee\u590d<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>LayoutBuilder &#043; \u65ad\u70b9\u5206\u652f<\/p>\n<p><\/span><\/p>\n<h3>\u4e94\u3001\u4fee\u590d\u65b9\u6848&#xff1a;\u6309\u573a\u666f\u5339\u914d\u66ff\u4ee3\u7b56\u7565<\/h3>\n<h4>\u7b2c\u4e00\u5c42&#xff1a;\u7528\u5f39\u6027\u7ea6\u675f\u66ff\u4ee3\u56fa\u5b9a\u5c3a\u5bf8<\/h4>\n<p>\u5bf9\u4e8e\u53c2\u4e0e Row\u3001Column \u6216 Flex \u5e03\u5c40\u7684\u5c3a\u5bf8&#xff0c;\u4f18\u5148\u4f7f\u7528 Expanded\u3001Flexible\u3001FractionallySizedBox \u6216 ConstrainedBox&#xff0c;\u800c\u4e0d\u662f\u56fa\u5b9a\u7684 width\/height\u3002<\/p>\n<p>FractionallySizedBox \u6839\u636e\u7236\u7ec4\u4ef6\u7684\u5c3a\u5bf8\u6309\u6bd4\u4f8b\u8bbe\u7f6e\u5b50\u7ec4\u4ef6\u5c3a\u5bf8&#xff0c;\u4f8b\u5982 widthFactor: 0.5 \u8868\u793a\u5b50\u7ec4\u4ef6\u5bbd\u5ea6\u4e3a\u7236\u7ec4\u4ef6\u5bbd\u5ea6\u7684 50%\u3002\u5b83\u4e0e MediaQuery.sizeOf(context).width * 0.5 \u7684\u5173\u952e\u533a\u522b\u662f&#xff1a;\u524d\u8005\u57fa\u4e8e\u7236\u7ea7\u7684\u5b9e\u9645\u7ea6\u675f&#xff0c;\u540e\u8005\u57fa\u4e8e\u6574\u4e2a\u5c4f\u5e55\u7684\u5c3a\u5bf8\u3002\u5728\u5d4c\u5957\u5e03\u5c40\u4e2d&#xff0c;\u524d\u8005\u901a\u5e38\u66f4\u7cbe\u786e\u3002<\/p>\n<p>AspectRatio \u7528\u4e8e\u4fdd\u6301\u5bbd\u9ad8\u6bd4&#xff0c;\u4f8b\u5982 aspectRatio: 16 \/ 9 \u7684\u5a92\u4f53\u5bb9\u5668\u3002\u5b83\u89e3\u51b3\u7684\u662f\u201c\u5bbd\u5ea6\u53d8\u5316\u65f6\u9ad8\u5ea6\u81ea\u52a8\u8ddf\u968f\u6bd4\u4f8b\u201d\u7684\u95ee\u9898&#xff0c;\u9002\u7528\u4e8e\u56fe\u7247\u3001\u89c6\u9891\u3001\u5361\u7247\u5c01\u9762\u7b49\u9700\u8981\u4fdd\u6301\u5f62\u72b6\u7684\u573a\u666f\u3002<\/p>\n<p>ConstrainedBox \u7528\u4e8e\u8bbe\u7f6e\u6700\u5c0f\u6216\u6700\u5927\u7ea6\u675f\u800c\u4e0d\u662f\u56fa\u5b9a\u5c3a\u5bf8\u3002\u5728\u6587\u672c\u5bb9\u5668\u7684\u4fee\u590d\u4e2d&#xff0c;ConstrainedBox(constraints: BoxConstraints(minHeight: 100)) \u6bd4 SizedBox(height: 100) \u66f4\u5b89\u5168&#xff1a;\u5b83\u4fdd\u8bc1\u5bb9\u5668\u81f3\u5c11 100 \u9ad8&#xff0c;\u4f46\u5141\u8bb8\u5728\u6587\u672c\u7f29\u653e\u65f6\u6269\u5c55\u5230\u8d85\u8fc7 100\u3002Material \u7684 ButtonStyle \u4e2d\u7684 minimumSize \u548c maximumSize \u4e5f\u662f\u540c\u4e00\u601d\u8def&#xff1a;\u7528\u7ea6\u675f\u8868\u8fbe\u201c\u81f3\u5c11\u591a\u5927\u201d&#xff0c;\u800c\u4e0d\u662f\u201c\u5fc5\u987b\u591a\u5927\u201d\u3002<\/p>\n<h4>\u7b2c\u4e8c\u5c42&#xff1a;\u7528 LayoutBuilder \u66ff\u4ee3 MediaQuery.sizeOf \u505a\u5c40\u90e8\u5c3a\u5bf8\u51b3\u7b56<\/h4>\n<p>MediaQuery.sizeOf \u9002\u5408\u201c\u57fa\u4e8e\u6574\u4e2a\u5e94\u7528\u7a97\u53e3\u51b3\u5b9a UI\u201d\u7684\u573a\u666f&#xff0c;\u4f8b\u5982\u5728\u5168\u5c4f\u548c\u5206\u5c4f\u4e4b\u95f4\u5207\u6362\u5bfc\u822a\u6a21\u5f0f\u3002LayoutBuilder \u9002\u5408\u201c\u57fa\u4e8e\u7236\u7ea7\u7ed9\u5f53\u524d Widget \u7684\u53ef\u7528\u7a7a\u95f4\u51b3\u5b9a\u5c3a\u5bf8\u6216\u5e03\u5c40\u201d\u7684\u573a\u666f\u3002<\/p>\n<p>\u4e00\u4e2a\u5178\u578b\u7684\u4fee\u590d\u6a21\u5f0f\u662f&#xff1a;\u628a\u201c\u57fa\u4e8e MediaQuery.sizeOf(context).width \u8ba1\u7b97\u5c3a\u5bf8\u201d\u7684\u4ee3\u7801&#xff0c;\u6539\u4e3a\u5305\u88f9\u5728 LayoutBuilder \u4e2d&#xff0c;\u4f7f\u7528 constraints.maxWidth\u3002\u8fd9\u4fee\u590d\u4e86\u201cWidget \u4f4d\u4e8e Padding\u3001Drawer\u3001Row \u7684 Expanded \u4e2d\u65f6&#xff0c;\u5c4f\u5e55\u5bbd\u5ea6\u4e0e\u53ef\u7528\u5bbd\u5ea6\u4e0d\u4e00\u81f4\u201d\u7684\u95ee\u9898\u3002<\/p>\n<p>OrientationBuilder \u662f LayoutBuilder \u7684\u4e00\u4e2a\u7279\u5316&#xff1a;\u5b83\u6bd4\u8f83\u7236\u7ea7\u7684\u53ef\u7528\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u6765\u51b3\u5b9a\u65b9\u5411&#xff0c;\u5e76\u5728\u7236\u7ea7\u5c3a\u5bf8\u53d8\u5316\u65f6\u91cd\u5efa\u3002\u5bf9\u4e8e\u201c\u6a2a\u7ad6\u5c4f\u9700\u8981\u4e0d\u540c\u5e03\u5c40\u201d\u7684\u573a\u666f&#xff0c;OrientationBuilder \u6bd4\u76f4\u63a5\u8bfb\u53d6 MediaQuery.orientation \u66f4\u53ef\u9760&#xff0c;\u56e0\u4e3a\u5b83\u57fa\u4e8e\u7684\u662f\u5f53\u524d Widget \u7684\u5b9e\u9645\u7ea6\u675f&#xff0c;\u800c\u4e0d\u662f\u7269\u7406\u5c4f\u5e55\u7684\u65b9\u5411\u3002<\/p>\n<h4>\u7b2c\u4e09\u5c42&#xff1a;\u8ba9\u6587\u672c\u5bb9\u5668\u7684\u9ad8\u5ea6\u7531\u5185\u5bb9\u51b3\u5b9a&#xff0c;\u800c\u4e0d\u662f\u7531\u56fa\u5b9a\u503c\u51b3\u5b9a<\/h4>\n<p>\u5bf9\u4efb\u4f55\u5305\u542b\u6587\u672c\u7684\u5bb9\u5668&#xff0c;\u79fb\u9664\u56fa\u5b9a\u9ad8\u5ea6&#xff0c;\u6539\u7528\u4ee5\u4e0b\u7b56\u7565\u4e4b\u4e00&#xff1a;<\/p>\n<p>\u5982\u679c\u5bb9\u5668\u53ea\u9700\u8981\u4e00\u4e2a\u6700\u5c0f\u9ad8\u5ea6&#xff0c;\u4f7f\u7528 ConstrainedBox(minHeight: &#8230;)&#xff0c;\u8ba9\u6587\u672c\u7f29\u653e\u65f6\u53ef\u4ee5\u6269\u5c55\u3002\u5982\u679c\u5bb9\u5668\u9700\u8981\u4e0e\u7236\u7ea7\u6216\u5144\u5f1f\u8282\u70b9\u5206\u914d\u7a7a\u95f4&#xff0c;\u4f7f\u7528 Expanded\/Flexible&#xff0c;\u8ba9\u9ad8\u5ea6\u7531\u5269\u4f59\u7a7a\u95f4\u51b3\u5b9a\u3002\u5982\u679c\u5bb9\u5668\u9700\u8981\u4fdd\u6301\u4e00\u4e2a\u89c6\u89c9\u4e0a\u7684\u5f62\u72b6&#xff0c;\u4f7f\u7528 AspectRatio \u6216 FractionallySizedBox&#xff0c;\u8ba9\u9ad8\u5ea6\u8ddf\u968f\u5bbd\u5ea6\u7684\u6bd4\u4f8b\u53d8\u5316&#xff0c;\u800c\u4e0d\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u56fa\u5b9a\u503c\u3002<\/p>\n<p>\u5bf9\u4e8e ListView \u7684 itemExtent \u6216 prototypeItem&#xff0c;\u5982\u679c\u5217\u8868\u9879\u5305\u542b\u53ef\u80fd\u56e0\u5b57\u4f53\u7f29\u653e\u800c\u53d8\u9ad8\u7684\u6587\u672c&#xff0c;\u4e0d\u8981\u4f7f\u7528\u56fa\u5b9a\u7684 itemExtent\u3002prototypeItem \u5141\u8bb8\u4f60\u63d0\u4f9b\u4e00\u4e2a\u201c\u539f\u578b\u201d\u5217\u8868\u9879&#xff0c;ListView \u4f1a\u6839\u636e\u5b83\u7684\u5b9e\u9645\u5e03\u5c40\u9ad8\u5ea6\u6765\u51b3\u5b9a\u6240\u6709\u5217\u8868\u9879\u7684\u9ad8\u5ea6&#xff1b;\u4f46\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8ba9 ListView \u81ea\u884c\u6d4b\u91cf\u6bcf\u4e2a\u5b50\u9879\u7684\u9ad8\u5ea6&#xff08;\u4e0d\u8bbe\u7f6e itemExtent&#xff09;&#xff0c;\u7531\u5b50\u9879\u7684\u5185\u5bb9\u548c\u7ea6\u675f\u534f\u5546\u51b3\u5b9a\u9ad8\u5ea6\u3002<\/p>\n<p>TextScaler.clamp \u53ef\u4ee5\u4f5c\u4e3a\u6700\u540e\u624b\u6bb5\u7528\u4e8e\u6781\u7aef\u5e03\u5c40\u7ea6\u675f\u7684\u573a\u666f&#xff08;\u4f8b\u5982\u4e00\u4e2a\u91d1\u989d\u8f93\u5165\u5c4f&#xff0c;\u91d1\u989d\u548c\u786e\u8ba4\u6309\u94ae\u5fc5\u987b\u540c\u65f6\u53ef\u89c1&#xff09;&#xff0c;\u4f46\u5b83\u7684\u5b9a\u4f4d\u662f\u201cnarrow case\u201d&#xff1a;\u5f53\u5c4f\u5e55\u5bc6\u96c6\u5230\u65e0\u754c\u7f29\u653e\u4f1a\u7834\u574f\u5173\u952e\u64cd\u4f5c\u65f6&#xff0c;\u624d\u9650\u5236\u7f29\u653e\u8303\u56f4\u3002clamp \u7684\u9ed8\u8ba4\u7528\u6cd5\u662f\u5728 MaterialApp.builder \u4e2d\u9650\u5236\u5168\u5c40\u7f29\u653e\u8303\u56f4&#xff1a;<\/p>\n<p>builder<span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">(<\/span>context<span class=\"token punctuation\">,<\/span> child<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#061;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token class-name\">MediaQuery<\/span><span class=\"token punctuation\">(<\/span><br \/>\n  data<span class=\"token punctuation\">:<\/span> <span class=\"token class-name\">MediaQuery<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">of<\/span><span class=\"token punctuation\">(<\/span>context<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">copyWith<\/span><span class=\"token punctuation\">(<\/span><br \/>\n    textScaler<span class=\"token punctuation\">:<\/span> <span class=\"token class-name\">MediaQuery<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">textScalerOf<\/span><span class=\"token punctuation\">(<\/span>context<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">.<\/span><span class=\"token function\">clamp<\/span><span class=\"token punctuation\">(<\/span>minScaleFactor<span class=\"token punctuation\">:<\/span> <span class=\"token number\">0.8<\/span><span class=\"token punctuation\">,<\/span> maxScaleFactor<span class=\"token punctuation\">:<\/span> <span class=\"token number\">1.6<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  child<span class=\"token punctuation\">:<\/span> child<span class=\"token operator\">!<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u4f46 clamp \u4e0e\u65e0\u969c\u788d\u8bbe\u7f6e\u662f\u5bf9\u6297\u7684&#xff0c;\u5b83\u5e94\u8be5\u53ea\u5728\u201c\u5e03\u5c40\u672c\u8eab\u5df2\u7ecf\u88ab\u8bbe\u8ba1\u4e3a\u5f39\u6027\u201d\u4e4b\u540e\u4ecd\u7136\u65e0\u6cd5\u5bb9\u7eb3\u65f6\u4f7f\u7528&#xff0c;\u800c\u4e0d\u662f\u4f5c\u4e3a\u56fa\u5b9a\u9ad8\u5ea6\u5bb9\u5668\u7684\u201c\u8865\u4e01\u201d\u3002\u5982\u679c\u5bb9\u5668\u7684\u56fa\u5b9a\u9ad8\u5ea6\u662f\u95ee\u9898\u7684\u6839\u6e90&#xff0c;\u4fee\u590d\u5bb9\u5668\u6bd4\u9650\u5236\u7528\u6237\u7684\u5b57\u4f53\u8bbe\u7f6e\u66f4\u6b63\u786e\u3002<\/p>\n<h4>\u7b2c\u56db\u5c42&#xff1a;\u7528 devicePixelRatio \u5904\u7406\u7269\u7406\u50cf\u7d20\u610f\u56fe&#xff0c;\u800c\u4e0d\u662f\u7528\u903b\u8f91\u50cf\u7d20\u731c\u6d4b<\/h4>\n<p>\u5f53\u8bbe\u8ba1\u610f\u56fe\u786e\u5b9e\u662f\u201c1 \u7269\u7406\u50cf\u7d20\u7684\u7ebf\u6761\u201d\u65f6&#xff0c;\u4f7f\u7528 1 \/ MediaQuery.devicePixelRatioOf(context) \u6765\u8ba1\u7b97\u903b\u8f91\u50cf\u7d20\u5bbd\u5ea6&#xff0c;\u800c\u4e0d\u662f\u76f4\u63a5\u5199 1\u3002\u5728 DPR \u4e3a 1.25 \u65f6&#xff0c;\u8fd9\u5f97\u5230 0.8 \u903b\u8f91\u50cf\u7d20&#xff0c;\u6e32\u67d3\u4e3a 1 \u7269\u7406\u50cf\u7d20&#xff1b;\u5728 DPR \u4e3a 2.625 \u65f6&#xff0c;\u5f97\u5230\u7ea6 0.381 \u903b\u8f91\u50cf\u7d20&#xff0c;\u6e32\u67d3\u4e3a 1 \u7269\u7406\u50cf\u7d20\u3002<\/p>\n<p>\u4f46\u9700\u8981\u6ce8\u610f&#xff1a;devicePixelRatio \u53ef\u80fd\u5728\u8fd0\u884c\u65f6\u53d8\u5316&#xff08;\u663e\u793a\u8bbe\u7f6e\u8c03\u6574\u3001\u7a97\u53e3\u8de8\u5c4f\u79fb\u52a8\u3001\u6298\u53e0\u5c4f\u5f62\u6001\u5207\u6362&#xff09;&#xff0c;\u4e0d\u8981\u7f13\u5b58\u5b83&#xff0c;\u800c\u662f\u5728 build \u4e2d\u901a\u8fc7 MediaQuery \u8bfb\u53d6&#xff0c;\u8fd9\u6837\u4f9d\u8d56\u5b83\u7684 Widget \u4f1a\u5728 devicePixelRatio \u53d8\u5316\u65f6\u81ea\u52a8\u91cd\u5efa\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u5e03\u5c40\u9700\u6c42&#xff08;padding\u3001\u95f4\u8ddd\u3001\u5b57\u4f53\u5927\u5c0f&#xff09;&#xff0c;\u903b\u8f91\u50cf\u7d20\u662f\u6b63\u786e\u7684\u5de5\u4f5c\u5355\u4f4d&#xff0c;\u4e0d\u9700\u8981\u663e\u5f0f\u5904\u7406 devicePixelRatio&#xff1b;\u53ea\u6709\u5f53\u4f60\u9700\u8981\u7cbe\u786e\u63a7\u5236\u7269\u7406\u50cf\u7d20\u6e32\u67d3&#xff08;1px \u8fb9\u6846\u3001\u50cf\u7d20\u7ea7\u5bf9\u9f50&#xff09;\u65f6&#xff0c;\u624d\u9700\u8981\u8fd9\u4e2a\u8f6c\u6362\u3002<\/p>\n<h4>\u7b2c\u4e94\u5c42&#xff1a;\u7528\u65ad\u70b9\u5206\u652f\u5904\u7406\u201c\u5e03\u5c40\u7ed3\u6784\u9700\u8981\u53d8\u5316\u201d\u7684\u573a\u666f<\/h4>\n<p>\u5f53\u95ee\u9898\u4e0d\u662f\u201c\u67d0\u4e2a\u5c3a\u5bf8\u4e0d\u5bf9\u201d&#xff0c;\u800c\u662f\u201c\u5c0f\u5c4f\u5e94\u8be5\u5355\u5217\u3001\u5927\u5c4f\u5e94\u8be5\u53cc\u5217\u201d\u65f6&#xff0c;Expanded \u6216 FractionallySizedBox \u65e0\u6cd5\u8868\u8fbe\u8fd9\u79cd\u7ed3\u6784\u53d8\u5316\u3002\u6b63\u786e\u7684\u5de5\u5177\u662f LayoutBuilder &#043; \u65ad\u70b9&#xff1a;<\/p>\n<p><span class=\"token class-name\">LayoutBuilder<\/span><span class=\"token punctuation\">(<\/span><br \/>\n  builder<span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">(<\/span>context<span class=\"token punctuation\">,<\/span> constraints<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>constraints<span class=\"token punctuation\">.<\/span>maxWidth <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">600<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token keyword\">return<\/span> <span class=\"token function\">_buildSingleColumn<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token function\">_buildTwoColumn<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><\/p>\n<p>Material Design \u7684\u7a97\u53e3\u5c3a\u5bf8\u7c7b\u5efa\u8bae\u4ee5 600 \u903b\u8f91\u50cf\u7d20\u4f5c\u4e3a\u5e95\u90e8\u5bfc\u822a\u680f\u548c\u5bfc\u822a rail \u7684\u5207\u6362\u65ad\u70b9\u3002\u65ad\u70b9\u7684\u9009\u62e9\u5e94\u8be5\u57fa\u4e8e\u53ef\u7528\u7a97\u53e3\u5c3a\u5bf8&#xff0c;\u800c\u4e0d\u662f\u8bbe\u5907\u7c7b\u578b&#xff08;\u624b\u673a\/\u5e73\u677f&#xff09;&#xff0c;\u56e0\u4e3a\u540c\u4e00\u4e2a\u8bbe\u5907\u53ef\u80fd\u5728\u5206\u5c4f\u3001\u6298\u53e0\u6216\u81ea\u7531\u7a97\u53e3\u6a21\u5f0f\u4e0b\u6709\u4e0d\u540c\u7684\u53ef\u7528\u5bbd\u5ea6\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4e94\u5c42\u4fee\u590d\u65b9\u6848\u7684\u51b3\u7b56\u6d41\u7a0b\u56fe&#xff1a;<\/p>\n<p>  #mermaid-svg-oUEwMj2nTjgVdXgE{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-oUEwMj2nTjgVdXgE .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-oUEwMj2nTjgVdXgE .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-oUEwMj2nTjgVdXgE .error-icon{fill:#552222;}#mermaid-svg-oUEwMj2nTjgVdXgE .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-oUEwMj2nTjgVdXgE .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-oUEwMj2nTjgVdXgE .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-oUEwMj2nTjgVdXgE .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-oUEwMj2nTjgVdXgE .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-oUEwMj2nTjgVdXgE .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-oUEwMj2nTjgVdXgE .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-oUEwMj2nTjgVdXgE .marker{fill:#333333;stroke:#333333;}#mermaid-svg-oUEwMj2nTjgVdXgE .marker.cross{stroke:#333333;}#mermaid-svg-oUEwMj2nTjgVdXgE svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-oUEwMj2nTjgVdXgE p{margin:0;}#mermaid-svg-oUEwMj2nTjgVdXgE .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-oUEwMj2nTjgVdXgE .cluster-label text{fill:#333;}#mermaid-svg-oUEwMj2nTjgVdXgE .cluster-label span{color:#333;}#mermaid-svg-oUEwMj2nTjgVdXgE .cluster-label span p{background-color:transparent;}#mermaid-svg-oUEwMj2nTjgVdXgE .label text,#mermaid-svg-oUEwMj2nTjgVdXgE span{fill:#333;color:#333;}#mermaid-svg-oUEwMj2nTjgVdXgE .node rect,#mermaid-svg-oUEwMj2nTjgVdXgE .node circle,#mermaid-svg-oUEwMj2nTjgVdXgE .node ellipse,#mermaid-svg-oUEwMj2nTjgVdXgE .node polygon,#mermaid-svg-oUEwMj2nTjgVdXgE .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-oUEwMj2nTjgVdXgE .rough-node .label text,#mermaid-svg-oUEwMj2nTjgVdXgE .node .label text,#mermaid-svg-oUEwMj2nTjgVdXgE .image-shape .label,#mermaid-svg-oUEwMj2nTjgVdXgE .icon-shape .label{text-anchor:middle;}#mermaid-svg-oUEwMj2nTjgVdXgE .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-oUEwMj2nTjgVdXgE .rough-node .label,#mermaid-svg-oUEwMj2nTjgVdXgE .node .label,#mermaid-svg-oUEwMj2nTjgVdXgE .image-shape .label,#mermaid-svg-oUEwMj2nTjgVdXgE .icon-shape .label{text-align:center;}#mermaid-svg-oUEwMj2nTjgVdXgE .node.clickable{cursor:pointer;}#mermaid-svg-oUEwMj2nTjgVdXgE .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-oUEwMj2nTjgVdXgE .arrowheadPath{fill:#333333;}#mermaid-svg-oUEwMj2nTjgVdXgE .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-oUEwMj2nTjgVdXgE .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-oUEwMj2nTjgVdXgE .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-oUEwMj2nTjgVdXgE .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-oUEwMj2nTjgVdXgE .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-oUEwMj2nTjgVdXgE .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-oUEwMj2nTjgVdXgE .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-oUEwMj2nTjgVdXgE .cluster text{fill:#333;}#mermaid-svg-oUEwMj2nTjgVdXgE .cluster span{color:#333;}#mermaid-svg-oUEwMj2nTjgVdXgE div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-oUEwMj2nTjgVdXgE .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-oUEwMj2nTjgVdXgE rect.text{fill:none;stroke-width:0;}#mermaid-svg-oUEwMj2nTjgVdXgE .icon-shape,#mermaid-svg-oUEwMj2nTjgVdXgE .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-oUEwMj2nTjgVdXgE .icon-shape p,#mermaid-svg-oUEwMj2nTjgVdXgE .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-oUEwMj2nTjgVdXgE .icon-shape .label rect,#mermaid-svg-oUEwMj2nTjgVdXgE .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-oUEwMj2nTjgVdXgE .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-oUEwMj2nTjgVdXgE .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-oUEwMj2nTjgVdXgE :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<\/p>\n<p>         <span class=\"edgeLabel\"><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u662f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u5426<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u662f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u5426<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u662f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u5426<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u662f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u5426<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u662f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"edgeLabel\"><\/p>\n<p>\u5426<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u9047\u5230\u5c3a\u5bf8\u9002\u914d\u95ee\u9898<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u53c2\u4e0e Flex \u5e03\u5c40&#xff1f;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u4e00\u5c42&#xff1a;Expanded \/ FlexibleFractionallySizedBox \/ ConstrainedBox<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u9700\u8981\u5c40\u90e8\u5c3a\u5bf8\u51b3\u7b56&#xff1f;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u4e8c\u5c42&#xff1a;LayoutBuilder\u66ff\u4ee3 MediaQuery.sizeOf<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5305\u542b\u6587\u672c\u7684\u5bb9\u5668&#xff1f;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u4e09\u5c42&#xff1a;\u79fb\u9664\u56fa\u5b9a\u9ad8\u5ea6ConstrainedBox(minHeight:)<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7269\u7406\u50cf\u7d20\u7ea7\u610f\u56fe&#xff1f;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u56db\u5c42&#xff1a;1 \/ devicePixelRatio\u8ba1\u7b97\u903b\u8f91\u50cf\u7d20\u5bbd\u5ea6<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u5e03\u5c40\u7ed3\u6784\u9700\u8981\u53d8\u5316&#xff1f;<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u7b2c\u4e94\u5c42&#xff1a;LayoutBuilder &#043; \u65ad\u70b9\u5206\u652f<\/p>\n<p><\/span><\/p>\n<p>         <span class=\"nodeLabel\"><\/p>\n<p>\u4fdd\u6301\u5f39\u6027\u7ea6\u675f\u5373\u53ef<\/p>\n<p><\/span><\/p>\n<h3>\u516d\u3001\u9884\u9632\u4f53\u7cfb&#xff1a;\u8ba9\u5c3a\u5bf8\u51b3\u7b56\u4ece\u201c\u6570\u503c\u201d\u53d8\u4e3a\u201c\u7ea6\u675f\u201d<\/h3>\n<h4>\u539f\u5219\u4e00&#xff1a;\u9ed8\u8ba4\u4f7f\u7528\u5f39\u6027\u7ea6\u675f&#xff0c;\u56fa\u5b9a\u5c3a\u5bf8\u9700\u8981\u7406\u7531<\/h4>\n<p>\u5728\u56e2\u961f\u89c4\u8303\u4e2d&#xff0c;\u5c06 Expanded\u3001Flexible\u3001FractionallySizedBox\u3001ConstrainedBox\u3001AspectRatio \u4f5c\u4e3a\u5c3a\u5bf8\u51b3\u7b56\u7684\u9ed8\u8ba4\u5de5\u5177\u7bb1\u3002\u4efb\u4f55\u76f4\u63a5\u5199\u4e0b\u7684 width \u6216 height \u5b57\u9762\u91cf&#xff0c;\u90fd\u9700\u8981\u4e00\u4e2a\u53ef\u9648\u8ff0\u7684\u7406\u7531&#xff1a;\u5b83\u662f\u4e00\u4e2a\u6709\u8bed\u4e49\u7684\u89e6\u6478\u76ee\u6807&#xff1f;\u5b83\u662f\u4e00\u4e2a\u56fe\u6807\u5c3a\u5bf8&#xff1f;\u5b83\u662f\u4e00\u4e2a\u8bbe\u8ba1\u7a3f\u4e2d\u660e\u786e\u8981\u6c42\u56fa\u5b9a\u7684\u88c5\u9970\u5143\u7d20&#xff1f;\u5982\u679c\u7406\u7531\u65e0\u6cd5\u9648\u8ff0&#xff0c;\u5b83\u5e94\u8be5\u88ab\u5f39\u6027\u7ea6\u675f\u66ff\u4ee3\u3002GitHub issue #616 \u5c06\u201cUtilize Flutter widgets like LayoutBuilder or MediaQuery\u201d\u4f5c\u4e3a\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u4fee\u590d\u65b9\u5411&#xff0c;\u6b63\u662f\u56e0\u4e3a\u8fd9\u4e9b\u5de5\u5177\u8868\u8fbe\u7684\u662f\u7ea6\u675f\u548c\u4e0a\u4e0b\u6587&#xff0c;\u800c\u4e0d\u662f\u5b64\u7acb\u7684\u6570\u503c\u3002<\/p>\n<h4>\u539f\u5219\u4e8c&#xff1a;\u5bf9\u5305\u542b\u6587\u672c\u7684\u5bb9\u5668&#xff0c;\u9ed8\u8ba4\u4e0d\u4f7f\u7528\u56fa\u5b9a\u9ad8\u5ea6<\/h4>\n<p>\u5c06\u201c\u5305\u542b Text \u7684\u5bb9\u5668\u4e0d\u4f7f\u7528 SizedBox(height:) \u56fa\u5b9a\u9ad8\u5ea6\u201d\u4f5c\u4e3a\u4e00\u6761\u786c\u6027\u89c4\u8303\u3002\u66ff\u4ee3\u65b9\u6848\u6309\u4f18\u5148\u7ea7\u6392\u5217&#xff1a;ConstrainedBox(minHeight:) &gt; IntrinsicHeight&#xff08;\u8c28\u614e\u4f7f\u7528&#xff09; &gt; Expanded\/Flexible&#xff08;\u5728\u6709\u754c\u7236\u7ea7\u4e2d&#xff09; &gt; \u8ba9\u5185\u5bb9\u81ea\u7136\u51b3\u5b9a\u9ad8\u5ea6\u3002flutter-skills \u7684\u89c4\u5219\u662f\u7cbe\u786e\u7684&#xff1a;\u201cAvoid hardcoded container heights around text; prefer flexible or scrollable containers\u201d\u3002\u8fd9\u6761\u89c4\u8303\u7684\u6d4b\u8bd5\u6210\u672c\u5f88\u4f4e&#xff1a;\u5728 TextScaler.linear(2.0) \u4e0b\u8fd0\u884c\u9875\u9762&#xff0c;\u4efb\u4f55\u88ab\u88c1\u526a\u6216\u63a8\u51fa\u5c4f\u5e55\u7684\u6587\u672c\u5bb9\u5668\u90fd\u662f\u8fdd\u89c4\u7684\u3002<\/p>\n<h4>\u539f\u5219\u4e09&#xff1a;\u533a\u5206 MediaQuery.sizeOf \u4e0e LayoutBuilder \u7684\u9002\u7528\u8fb9\u754c<\/h4>\n<p>MediaQuery.sizeOf \u9002\u5408\u201c\u57fa\u4e8e\u6574\u4e2a\u5e94\u7528\u7a97\u53e3\u7684\u5c3a\u5bf8\u505a\u51b3\u7b56\u201d&#xff08;\u5168\u5c4f\/\u5206\u5c4f\u5207\u6362\u3001\u5bfc\u822a\u6a21\u5f0f\u5207\u6362&#xff09;\u3002LayoutBuilder \u9002\u5408\u201c\u57fa\u4e8e\u5f53\u524d Widget \u4ece\u7236\u7ea7\u83b7\u5f97\u7684\u7ea6\u675f\u505a\u51b3\u7b56\u201d&#xff08;\u5c40\u90e8\u5e03\u5c40\u3001\u5d4c\u5957\u4e2d\u7684\u5c3a\u5bf8\u8ba1\u7b97&#xff09;\u3002OrientationBuilder \u9002\u5408\u201c\u57fa\u4e8e\u5f53\u524d Widget \u7684\u53ef\u7528\u5bbd\u9ad8\u6bd4\u505a\u65b9\u5411\u76f8\u5173\u51b3\u7b56\u201d\u3002\u5728 code review \u4e2d&#xff0c;\u5f53\u4e00\u4e2a\u5c3a\u5bf8\u8ba1\u7b97\u4f7f\u7528 MediaQuery.sizeOf \u65f6&#xff0c;\u786e\u8ba4\u8fd9\u4e2a\u5c3a\u5bf8\u662f\u5426\u771f\u7684\u5e94\u8be5\u57fa\u4e8e\u6574\u4e2a\u5c4f\u5e55&#xff1b;\u5982\u679c Widget \u4f4d\u4e8e\u4e00\u4e2a\u53d7\u7ea6\u675f\u7684\u5c40\u90e8\u4e2d&#xff0c;LayoutBuilder \u51e0\u4e4e\u603b\u662f\u66f4\u7cbe\u786e\u7684\u9009\u62e9\u3002<\/p>\n<h4>\u539f\u5219\u56db&#xff1a;\u628a devicePixelRatio \u5f53\u4f5c\u201c\u7269\u7406\u50cf\u7d20\u6e32\u67d3\u201d\u7684\u5de5\u5177&#xff0c;\u800c\u4e0d\u662f\u201c\u5e03\u5c40\u201d\u7684\u5de5\u5177<\/h4>\n<p>\u5927\u591a\u6570\u5e03\u5c40\u5c3a\u5bf8&#xff08;padding\u3001margin\u3001\u5b57\u4f53\u5927\u5c0f\u3001\u95f4\u8ddd&#xff09;\u5e94\u8be5\u4f7f\u7528\u903b\u8f91\u50cf\u7d20&#xff0c;\u4e0d\u9700\u8981\u663e\u5f0f\u5904\u7406 devicePixelRatio\u3002\u53ea\u6709\u5f53\u8bbe\u8ba1\u610f\u56fe\u6d89\u53ca\u7269\u7406\u50cf\u7d20\u7ea7\u7cbe\u5ea6&#xff08;1px \u5206\u5272\u7ebf\u3001\u50cf\u7d20\u5bf9\u9f50\u7684\u56fe\u6807\u3001\u907f\u514d\u5206\u6570 DPR \u4e0b\u7684\u6a21\u7cca&#xff09;\u65f6&#xff0c;\u624d\u4f7f\u7528 1 \/ devicePixelRatio \u6765\u8ba1\u7b97\u903b\u8f91\u50cf\u7d20\u5bbd\u5ea6\u3002\u4e0d\u8981\u7f13\u5b58 devicePixelRatio&#xff0c;\u8ba9\u4f9d\u8d56\u5b83\u7684 Widget \u901a\u8fc7 MediaQuery \u5728\u53d8\u5316\u65f6\u91cd\u5efa\u3002\u5bf9\u4e8e\u5206\u6570 DPR \u4e0b\u7684\u50cf\u7d20\u5bf9\u9f50\u95ee\u9898&#xff0c;pixel_snap \u8fd9\u7c7b\u5de5\u5177\u53ef\u4ee5\u63d0\u4f9b PixelSnap \u5305\u88c5\u5668\u6765\u5c06\u903b\u8f91\u50cf\u7d20\u5bf9\u9f50\u5230\u7269\u7406\u50cf\u7d20\u7f51\u683c\u3002<\/p>\n<h4>\u539f\u5219\u4e94&#xff1a;\u5728 CI \u548c\u8bbe\u5907\u77e9\u9635\u4e2d\u8986\u76d6\u201c\u6781\u7aef\u4f46\u5408\u6cd5\u201d\u7684\u914d\u7f6e<\/h4>\n<p>\u5c3a\u5bf8\u786c\u7f16\u7801\u7684\u8bb8\u591a\u6545\u969c\u5728\u5f00\u53d1\u8005\u7684\u9ed8\u8ba4\u8bbe\u5907\u3001\u9ed8\u8ba4\u5b57\u4f53\u8bbe\u7f6e\u4e0b\u4e0d\u53ef\u89c1\u3002\u6d4b\u8bd5\u77e9\u9635\u5e94\u8be5\u81f3\u5c11\u5305\u62ec&#xff1a;\u5c0f\u5c4f\u8bbe\u5907&#xff08;\u7ea6 320-360 \u903b\u8f91\u50cf\u7d20\u5bbd&#xff09;\u3001\u5927\u5c4f\u8bbe\u5907\u6216\u684c\u9762\u7a97\u53e3\u3001\u6a2a\u5c4f\u65b9\u5411\u3001TextScaler.linear(1.5)\u3001TextScaler.linear(2.0)\u3001\u4ee5\u53ca\u4e00\u4e2a\u5206\u6570 devicePixelRatio \u7684\u914d\u7f6e&#xff08;\u4f8b\u5982 DPR 1.25 \u6216 2.625&#xff09;\u3002Flutter \u7684 Widget \u6d4b\u8bd5\u53ef\u4ee5\u901a\u8fc7 tester.binding.window.physicalSizeTestValue \u548c tester.binding.window.devicePixelRatioTestValue \u6a21\u62df\u4e0d\u540c\u7684\u5c3a\u5bf8\u548c DPR&#xff1b;MediaQuery \u53ef\u4ee5\u5728\u6d4b\u8bd5\u4e2d\u8986\u76d6 textScaler\u3002\u628a\u201c\u5728 200% \u5b57\u4f53\u4e0b\u622a\u56fe\u5bf9\u6bd4\u201d\u4f5c\u4e3a\u89c6\u89c9\u56de\u5f52\u6d4b\u8bd5\u7684\u4e00\u90e8\u5206&#xff0c;\u53ef\u4ee5\u5728\u4ee3\u7801\u5408\u5e76\u4e4b\u524d\u6355\u83b7\u56fa\u5b9a\u9ad8\u5ea6\u5bb9\u5668\u7684\u88c1\u526a\u3002<\/p>\n<h3>\u4e03\u3001\u8bfe\u540e\u4e60\u9898&#xff08;15\u9053&#xff09;<\/h3>\n<h4>\u4e60\u98981&#xff08;\u5355\u9009&#xff09;<\/h4>\n<p>MediaQueryData.size \u8fd4\u56de\u7684\u5c3a\u5bf8\u5355\u4f4d\u662f&#xff1a;<\/p>\n<p>A. \u7269\u7406\u50cf\u7d20 B. \u903b\u8f91\u50cf\u7d20 C. \u8bbe\u5907\u65e0\u5173\u50cf\u7d20&#xff08;\u4e0e\u903b\u8f91\u50cf\u7d20\u542b\u4e49\u4e0d\u540c&#xff09; D. \u5398\u7c73<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;B<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u5b98\u65b9\u5b9a\u4e49\u662f&#xff1a;\u201cThe size of the media in logical pixels\u201d\u3002\u903b\u8f91\u50cf\u7d20\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u89c6\u89c9\u5927\u5c0f\u5927\u81f4\u76f8\u540c&#xff0c;\u7269\u7406\u50cf\u7d20\u662f\u786c\u4ef6\u50cf\u7d20&#xff0c;\u4e24\u8005\u901a\u8fc7 devicePixelRatio \u5173\u8054\u3002MediaQuery.sizeOf(context) \u8fd4\u56de\u903b\u8f91\u50cf\u7d20\u5c3a\u5bf8&#xff0c;\u8981\u5f97\u5230\u7269\u7406\u50cf\u7d20\u5c3a\u5bf8\u9700\u8981\u4e58\u4ee5 devicePixelRatio\u3002<\/p>\n<h4>\u4e60\u98982&#xff08;\u5224\u65ad&#xff09;<\/h4>\n<p>\u7528 screenHeight \/ 3.55 \u8ba1\u7b97\u5bb9\u5668\u9ad8\u5ea6&#xff0c;\u56e0\u4e3a\u4f7f\u7528\u4e86\u5c4f\u5e55\u9ad8\u5ea6\u4f5c\u4e3a\u57fa\u51c6&#xff0c;\u6240\u4ee5\u5b83\u5c5e\u4e8e\u54cd\u5e94\u5f0f\u5e03\u5c40&#xff0c;\u4e0d\u4f1a\u4ea7\u751f\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u95ee\u9898\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;\u9519\u8bef<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u8fd9\u79cd\u8ba1\u7b97\u53ea\u662f\u628a\u201c\u56fa\u5b9a\u7684\u6570\u503c\u201d\u6362\u6210\u4e86\u201c\u56fa\u5b9a\u7684\u6bd4\u4f8b\u201d&#xff0c;\u5b83\u4ecd\u7136\u4e0d\u5173\u5fc3\u5bb9\u5668\u7684\u5185\u5bb9\u3001\u53ef\u7528\u5bbd\u5ea6\u3001\u5b57\u4f53\u7f29\u653e\u6216\u5b89\u5168\u533a\u3002\u5f53\u5c4f\u5e55\u9ad8\u5ea6\u53d8\u5316\u65f6&#xff0c;\u6bd4\u4f8b\u503c\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u7f29\u653e&#xff0c;\u4f46\u5b83\u4e0e\u5185\u90e8\u5143\u7d20&#xff08;\u6587\u672c\u3001padding\u3001\u5144\u5f1f\u7ec4\u4ef6&#xff09;\u7684\u5c3a\u5bf8\u53d8\u5316\u6ca1\u6709\u4efb\u4f55\u534f\u5546\u3002\u5bbd\u5ea6\u7684\u8ba1\u7b97\u751a\u81f3\u53ef\u80fd\u9519\u8bef\u5730\u4f7f\u7528 screenHeight \u4f5c\u4e3a\u5206\u6bcd&#xff0c;\u5bfc\u81f4\u6a2a\u5c4f\u6216\u4e0d\u540c\u5bbd\u9ad8\u6bd4\u4e0b\u4ea7\u751f\u65e0\u5173\u7ed3\u679c\u3002\u771f\u6b63\u7684\u54cd\u5e94\u5f0f\u5e03\u5c40\u9700\u8981\u57fa\u4e8e\u7ea6\u675f\u548c\u5185\u5bb9&#xff0c;\u800c\u4e0d\u662f\u5c4f\u5e55\u67d0\u4e00\u4e2a\u7ef4\u5ea6\u9664\u4ee5\u9b54\u6cd5\u6570\u5b57\u3002<\/p>\n<h4>\u4e60\u98983&#xff08;\u591a\u9009&#xff09;<\/h4>\n<p>\u4ee5\u4e0b\u54ea\u4e9b\u662f\u786c\u7f16\u7801\u5c3a\u5bf8\u5728\u591a\u8bbe\u5907\u73af\u5883\u4e2d\u7684\u5178\u578b\u5371\u5bb3&#xff1f;<\/p>\n<p>A. \u4e0d\u54cd\u5e94\u4e0d\u540c\u7684\u5c4f\u5e55\u5c3a\u5bf8\u6216\u65b9\u5411 B. \u5728\u4e0d\u540c\u5c4f\u5e55\u5c3a\u5bf8\u4e0a\u9020\u6210\u4e0d\u4e00\u81f4\u7684 UI C. \u5f53\u5b57\u4f53\u7f29\u653e\u6216\u672c\u5730\u5316\u5bfc\u81f4\u5185\u5bb9\u957f\u5ea6\u53d8\u5316\u65f6\u7834\u574f\u5e03\u5c40 D. \u5728\u7f16\u8bd1\u671f\u4ea7\u751f\u7c7b\u578b\u9519\u8bef<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;A\u3001B\u3001C<\/p>\n<p>\u89e3\u8bfb&#xff1a; A\u3001B\u3001C \u90fd\u662f GitHub issue #616 \u4e2d\u7cfb\u7edf\u5217\u51fa\u7684\u786c\u7f16\u7801\u5c3a\u5bf8\u5371\u5bb3&#xff1a;\u201cHardcoded dimensions do not adapt to different screen sizes or orientations, leading to poor user experience\u201d&#xff1b;\u201cHardcoded values may cause inconsistencies across different screen sizes\u201d&#xff1b;\u201cHardcoded dimensions can break layouts when the app content changes dynamically (e.g., localization, font scaling, or varying data)\u201d\u3002D \u662f\u9519\u8bef\u7684&#xff1a;\u786c\u7f16\u7801\u5c3a\u5bf8\u662f\u4e00\u4e2a\u8bbe\u8ba1\u548c\u5e03\u5c40\u95ee\u9898&#xff0c;\u4e0d\u662f\u7f16\u8bd1\u671f\u7c7b\u578b\u9519\u8bef&#xff1b;Dart \u7f16\u8bd1\u5668\u4e0d\u4f1a\u56e0\u4e3a width: 100 \u800c\u62a5\u9519\u3002<\/p>\n<h4>\u4e60\u98984&#xff08;\u573a\u666f\u5206\u6790&#xff09;<\/h4>\n<p>\u4e00\u4e2a SizedBox(height: 100) \u5305\u542b\u4e24\u884c\u6587\u672c\u3002\u5728 100% \u5b57\u4f53\u4e0b\u5e03\u5c40\u6b63\u5e38\u3002\u7528\u6237\u5c06\u7cfb\u7edf\u5b57\u4f53\u653e\u5927\u5230 160% \u540e&#xff0c;\u6587\u672c\u88ab\u88c1\u526a\u3002\u8bf7\u89e3\u91ca\u6839\u56e0&#xff0c;\u5e76\u7ed9\u51fa\u4fee\u590d\u65b9\u6848\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a; \u6839\u56e0&#xff1a;SizedBox(height: 100) \u5728\u6587\u672c\u5e03\u5c40\u4e4b\u524d\u5c31\u5355\u65b9\u9762\u786e\u5b9a\u4e86\u9ad8\u5ea6\u3002TextScaler \u5728\u5e03\u5c40\u65f6\u5c06\u6587\u672c\u7684\u7f29\u653e\u56e0\u5b50\u8c03\u6574\u4e3a 1.6&#xff0c;TextPainter \u8ba1\u7b97\u51fa\u7684\u6587\u672c\u9ad8\u5ea6\u8d85\u8fc7\u4e86 100 \u903b\u8f91\u50cf\u7d20&#xff0c;\u4f46 SizedBox \u7684\u7ea6\u675f\u4e0d\u4f1a\u56e0\u4e3a\u6587\u672c\u53d8\u9ad8\u800c\u6269\u5c55\u3002Column \u5728 100 \u50cf\u7d20\u5185\u65e0\u6cd5\u5b89\u6392\u653e\u5927\u7684\u6587\u672c&#xff0c;\u6ea2\u51fa\u6216\u88c1\u526a\u53d1\u751f\u3002\u4fee\u590d\u65b9\u6848&#xff1a;\u79fb\u9664\u56fa\u5b9a\u9ad8\u5ea6&#xff0c;\u4f7f\u7528 ConstrainedBox(constraints: BoxConstraints(minHeight: 100))&#xff0c;\u8ba9\u5bb9\u5668\u81f3\u5c11 100 \u9ad8&#xff0c;\u4f46\u5141\u8bb8\u5728\u6587\u672c\u7f29\u653e\u65f6\u6269\u5c55\u5230\u8d85\u8fc7 100\u3002\u5728 100% \u7f29\u653e\u6bd4\u4f8b\u4e0b\u5e03\u5c40\u4fdd\u6301\u4e0d\u53d8&#xff0c;\u5728 160% \u4e0b\u5bb9\u5668\u81ea\u52a8\u6269\u5c55\u3002<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u8fd9\u4e2a\u6848\u4f8b\u7684\u7cbe\u786e\u673a\u5236\u662f\u201c\u56fa\u5b9a\u9ad8\u5ea6\u9884\u8bbe\u4e86\u4e00\u4e2a\u4e0e\u6587\u672c\u7f29\u653e\u65e0\u5173\u7684\u5047\u8bbe\u201d\u3002TextScaler \u662f\u4e00\u4e2a\u4e0e\u5c4f\u5e55\u5c3a\u5bf8\u6b63\u4ea4\u7684\u7ef4\u5ea6&#xff1b;\u4e00\u4e2a\u5728\u5c4f\u5e55\u5c3a\u5bf8\u4e0a\u201c\u54cd\u5e94\u5f0f\u201d\u7684\u5e03\u5c40&#xff0c;\u5982\u679c\u4f7f\u7528\u4e86\u56fa\u5b9a\u9ad8\u5ea6\u7684\u6587\u672c\u5bb9\u5668&#xff0c;\u5728\u5b57\u4f53\u7f29\u653e\u7ef4\u5ea6\u4e0a\u4ecd\u7136\u662f\u786c\u7f16\u7801\u7684\u3002\u4fee\u590d\u7684\u6838\u5fc3\u4e0d\u662f\u201c\u8ba9\u5bb9\u5668\u5728\u5c4f\u5e55\u5c3a\u5bf8\u53d8\u5316\u65f6\u7f29\u653e\u201d&#xff0c;\u800c\u662f\u201c\u8ba9\u5bb9\u5668\u7684\u9ad8\u5ea6\u7531\u5185\u5bb9\u51b3\u5b9a\u201d\u3002<\/p>\n<h4>\u4e60\u98985&#xff08;\u5355\u9009&#xff09;<\/h4>\n<p>FractionallySizedBox \u4e0e MediaQuery.sizeOf(context).width * 0.5 \u8ba1\u7b97\u5bbd\u5ea6\u7684\u5173\u952e\u533a\u522b\u662f&#xff1a;<\/p>\n<p>A. FractionallySizedBox \u57fa\u4e8e\u7236\u7ec4\u4ef6\u7684\u5b9e\u9645\u7ea6\u675f&#xff0c;\u540e\u8005\u57fa\u4e8e\u6574\u4e2a\u5e94\u7528\u5c4f\u5e55\u7684\u5c3a\u5bf8 B. FractionallySizedBox \u53ea\u80fd\u7528\u4e8e Row&#xff0c;\u540e\u8005\u53ef\u4ee5\u7528\u4e8e\u4efb\u4f55\u5730\u65b9 C. \u4e24\u8005\u5b8c\u5168\u7b49\u4ef7&#xff0c;\u53ea\u662f\u8bed\u6cd5\u4e0d\u540c D. FractionallySizedBox \u4f7f\u7528\u7269\u7406\u50cf\u7d20&#xff0c;\u540e\u8005\u4f7f\u7528\u903b\u8f91\u50cf\u7d20<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;A<\/p>\n<p>\u89e3\u8bfb&#xff1a; FractionallySizedBox \u6839\u636e\u7236\u7ec4\u4ef6\u7684\u5c3a\u5bf8\u6309\u6bd4\u4f8b\u8bbe\u7f6e\u5b50\u7ec4\u4ef6\u5c3a\u5bf8\u3002MediaQuery.sizeOf(context).width \u8fd4\u56de\u7684\u662f\u5e94\u7528\u6574\u4e2a\u5c4f\u5e55\u7684\u5f53\u524d\u5c3a\u5bf8&#xff0c;\u800c\u4e0d\u662f\u5f53\u524d Widget \u7684\u53ef\u7528\u7a7a\u95f4\u3002\u5f53\u4e00\u4e2a Widget \u4f4d\u4e8e Padding\u3001Drawer \u6216 Row \u7684 Expanded \u4e2d\u65f6&#xff0c;\u5b83\u7684\u53ef\u7528\u5bbd\u5ea6\u5c0f\u4e8e MediaQuery.sizeOf \u8fd4\u56de\u7684\u5bbd\u5ea6&#xff1b;FractionallySizedBox \u7684\u767e\u5206\u6bd4\u57fa\u4e8e\u5b9e\u9645\u53ef\u7528\u7684\u7ea6\u675f&#xff0c;\u56e0\u6b64\u5728\u8fd9\u4e2a\u573a\u666f\u4e2d\u66f4\u7cbe\u786e\u3002B\u3001C\u3001D \u90fd\u662f\u9519\u8bef\u7684&#xff1a;FractionallySizedBox \u53ef\u4ee5\u7528\u4e8e\u4efb\u4f55\u6709\u7ea6\u675f\u7684\u7236\u7ea7&#xff1b;\u4e24\u8005\u4e0d\u7b49\u4ef7&#xff1b;\u4e24\u8005\u90fd\u4f7f\u7528\u903b\u8f91\u50cf\u7d20\u3002<\/p>\n<h4>\u4e60\u98986&#xff08;\u591a\u9009&#xff09;<\/h4>\n<p>\u5173\u4e8e LayoutBuilder \u4e0e MediaQuery.sizeOf \u7684\u9009\u62e9&#xff0c;\u4ee5\u4e0b\u8bf4\u6cd5\u6b63\u786e\u7684\u662f&#xff1a;<\/p>\n<p>A. LayoutBuilder \u63d0\u4f9b\u7236\u7ea7\u7ed9\u5f53\u524d Widget \u7684\u7ea6\u675f&#xff0c;MediaQuery.sizeOf \u63d0\u4f9b\u5e94\u7528\u6574\u4e2a\u5c4f\u5e55\u7684\u5c3a\u5bf8 B. \u5f53\u5e03\u5c40\u9700\u8981\u57fa\u4e8e\u201c\u8fd9\u4e2a Widget \u5b9e\u9645\u6709\u591a\u5c11\u53ef\u7528\u7a7a\u95f4\u201d\u65f6&#xff0c;LayoutBuilder \u66f4\u5408\u9002 C. \u5f53\u5e03\u5c40\u9700\u8981\u57fa\u4e8e\u201c\u6574\u4e2a\u5e94\u7528\u7a97\u53e3\u7684\u5c3a\u5bf8\u201d\u9009\u62e9 UI \u6a21\u5f0f\u65f6&#xff0c;MediaQuery.sizeOf \u66f4\u5408\u9002 D. LayoutBuilder \u8fd4\u56de\u4e00\u4e2a\u56fa\u5b9a\u7684 Size&#xff0c;MediaQuery.sizeOf \u8fd4\u56de BoxConstraints<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;A\u3001B\u3001C<\/p>\n<p>\u89e3\u8bfb&#xff1a; A\u3001B\u3001C \u90fd\u662f\u5b98\u65b9\u6587\u6863\u5bf9\u4e24\u8005\u533a\u522b\u7684\u7cbe\u786e\u63cf\u8ff0&#xff1a;\u201cMediaQuery.sizeOf returns the current size of the app\u2019s entire screen and not just a single widget\u201d&#xff1b;\u201cLayoutBuilder provides the parent widget\u2019s layout constraints, i.e. the size information depending on where you add the LayoutBuilder in the widget tree\u201d\u3002D \u662f\u9519\u8bef\u7684&#xff1a;LayoutBuilder \u8fd4\u56de BoxConstraints&#xff08;\u5bbd\u9ad8\u7684\u6709\u6548\u8303\u56f4&#xff09;&#xff0c;MediaQuery.sizeOf \u8fd4\u56de Size&#xff08;\u56fa\u5b9a\u7684\u5bbd\u9ad8\u503c&#xff09;\u3002\u4e24\u8005\u5728\u8fd4\u56de\u7c7b\u578b\u4e0a\u6b63\u597d\u76f8\u53cd\u3002<\/p>\n<h4>\u4e60\u98987&#xff08;\u5224\u65ad&#xff09;<\/h4>\n<p>devicePixelRatio \u662f\u4e00\u4e2a\u56fa\u5b9a\u4e0d\u53d8\u7684\u503c&#xff0c;\u53ef\u4ee5\u5728\u5e94\u7528\u542f\u52a8\u65f6\u8bfb\u53d6\u4e00\u6b21\u5e76\u7f13\u5b58&#xff0c;\u540e\u7eed\u6240\u6709\u5e03\u5c40\u90fd\u4f7f\u7528\u8fd9\u4e2a\u7f13\u5b58\u503c\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;\u9519\u8bef<\/p>\n<p>\u89e3\u8bfb&#xff1a; devicePixelRatio \u53ef\u80fd\u5728\u8fd0\u884c\u65f6\u53d8\u5316&#xff1a;\u7528\u6237\u66f4\u6539\u7cfb\u7edf\u663e\u793a\u7f29\u653e\u3001\u5c06\u7a97\u53e3\u4ece\u9ad8 DPI \u62d6\u5230\u4f4e DPI \u663e\u793a\u5668\u3001\u6298\u53e0\u5c4f\u5207\u6362\u5f62\u6001\u3002\u76f4\u63a5\u7f13\u5b58\u8fd9\u4e2a\u503c\u4f1a\u5bfc\u81f4\u5e94\u7528\u5728\u663e\u793a\u8bbe\u7f6e\u53d8\u5316\u540e\u4e0d\u518d\u54cd\u5e94\u3002\u6b63\u786e\u7684\u505a\u6cd5\u662f\u5728 build \u4e2d\u901a\u8fc7 MediaQuery \u8bfb\u53d6&#xff08;MediaQuery.devicePixelRatioOf(context)&#xff09;&#xff0c;\u4f9d\u8d56\u5b83\u7684 Widget \u4f1a\u5728\u503c\u53d8\u5316\u65f6\u81ea\u52a8\u91cd\u5efa\u3002\u5b98\u65b9\u6587\u6863\u4e5f\u660e\u786e\u6307\u51fa&#xff0c;\u201cIt is considered bad practice to cache and later use the size returned by MediaQuery.sizeOf(context)\u201d&#xff0c;\u540c\u6837\u7684\u539f\u5219\u9002\u7528\u4e8e devicePixelRatio\u3002<\/p>\n<h4>\u4e60\u98988&#xff08;\u573a\u666f\u5206\u6790&#xff09;<\/h4>\n<p>\u4e00\u4f4d\u5f00\u53d1\u8005\u4f7f\u7528 flutter_screenutil&#xff0c;\u4ee5 Figma \u8bbe\u8ba1\u7a3f\u7684 430\u00d7932 \u4e3a\u57fa\u51c6&#xff0c;\u901a\u8fc7 .w\u3001.h\u3001.sp \u7f29\u653e\u6240\u6709\u5c3a\u5bf8\u3002\u5728\u63a5\u8fd1\u8bbe\u8ba1\u7a3f\u5c3a\u5bf8\u7684\u8bbe\u5907\u4e0a\u8868\u73b0\u826f\u597d&#xff0c;\u4f46\u5728 360 \u903b\u8f91\u50cf\u7d20\u5bbd\u7684\u624b\u673a\u4e0a\u5e03\u5c40\u65ad\u88c2\u3002\u8bf7\u89e3\u91ca\u6839\u56e0&#xff0c;\u5e76\u8bf4\u660e\u8fd9\u4e2a\u95ee\u9898\u7684\u6027\u8d28\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a; \u6839\u56e0&#xff1a;screen_utils \u5c06\u5c3a\u5bf8\u4e58\u4ee5\u4e00\u4e2a\u57fa\u4e8e\u201c\u8bbe\u8ba1\u7a3f\u5bbd\u5ea6 \/ \u8bbe\u5907\u5bbd\u5ea6\u201d\u7684\u7ebf\u6027\u7f29\u653e\u56e0\u5b50\u3002\u8fd9\u79cd\u7f29\u653e\u9002\u7528\u4e8e\u201c\u8bbe\u8ba1\u7a3f\u7684\u5e03\u5c40\u7ed3\u6784\u4e0d\u53d8&#xff0c;\u53ea\u9700\u8981\u5728\u4e0d\u540c\u5bc6\u5ea6\u4e0a\u4fdd\u6301\u89c6\u89c9\u6bd4\u4f8b\u201d\u7684\u573a\u666f\u3002\u4f46\u5728 360 \u5bbd\u7684\u8bbe\u5907\u4e0a&#xff0c;\u6309\u94ae\u3001\u6587\u672c\u3001\u56fe\u6807\u3001\u95f4\u8ddd\u5e76\u4e0d\u4e00\u5b9a\u6309\u76f8\u540c\u7684\u6bd4\u4f8b\u7f29\u653e&#xff08;.sp \u6709\u72ec\u7acb\u7684\u5b57\u4f53\u7f29\u653e\u903b\u8f91&#xff0c;\u4e0d\u540c\u5143\u7d20\u7684\u56fa\u6709\u5c3a\u5bf8\u4e5f\u4e0d\u540c&#xff09;&#xff0c;\u5185\u90e8\u5143\u7d20\u4e4b\u95f4\u7684\u6bd4\u4f8b\u5173\u7cfb\u4f1a\u53d1\u751f\u53d8\u5316\u3002\u66f4\u6839\u672c\u7684\u662f&#xff0c;screen_utils \u4e0d\u5904\u7406\u201c\u5e03\u5c40\u7ed3\u6784\u9700\u8981\u6839\u636e\u53ef\u7528\u7a7a\u95f4\u6539\u53d8\u201d\u7684\u573a\u666f&#xff08;\u4f8b\u5982\u5c0f\u5c4f\u5355\u5217\u3001\u5927\u5c4f\u53cc\u5217&#xff09;&#xff0c;\u5b83\u53ea\u505a\u6570\u503c\u7f29\u653e\u3002Latenode \u793e\u533a\u7684\u56de\u7b54\u5c06\u8fd9\u4e2a\u95ee\u9898\u5b9a\u6027\u4e3a\u201c\u5de5\u4f5c\u6d41\u95ee\u9898\u201d\u800c\u4e0d\u662f\u201cFlutter \u95ee\u9898\u201d&#xff1a;\u201cyou\u2019re treating responsive design like a Flutter issue when it\u2019s really a workflow issue\u201d\u3002<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u8fd9\u4e2a\u6848\u4f8b\u7684\u4ef7\u503c\u5728\u4e8e\u533a\u5206\u201c\u7b49\u6bd4\u7f29\u653e\u201d\u548c\u201c\u54cd\u5e94\u5f0f\u5e03\u5c40\u201d\u3002screen_utils \u662f\u4e00\u4e2a\u6709\u7528\u7684\u5de5\u5177&#xff0c;\u4f46\u5b83\u7684\u9002\u7528\u8303\u56f4\u662f\u201c\u8bbe\u8ba1\u610f\u56fe\u5c31\u662f\u7b49\u6bd4\u7f29\u653e\u201d\u7684\u573a\u666f\u3002\u5f53\u8bbe\u8ba1\u610f\u56fe\u9700\u8981\u5728\u4e0d\u540c\u5c3a\u5bf8\u4e0a\u6539\u53d8\u5e03\u5c40\u7ed3\u6784\u65f6&#xff0c;LayoutBuilder &#043; \u65ad\u70b9\u5206\u652f\u662f\u66f4\u5408\u9002\u7684\u5de5\u5177\u3002\u628a screen_utils \u5f53\u4f5c\u201c\u4e07\u80fd\u9002\u914d\u65b9\u6848\u201d&#xff0c;\u4f1a\u5728\u5c0f\u5c4f\u6216\u6a2a\u5c4f\u4e0b\u66b4\u9732\u51fa\u201c\u7f29\u653e\u4e86\u4f46\u6ca1\u6709\u91cd\u65b0\u6392\u5217\u201d\u7684\u95ee\u9898\u3002<\/p>\n<h4>\u4e60\u98989&#xff08;\u5355\u9009&#xff09;<\/h4>\n<p>\u5728 DPR \u4e3a 1.25 \u7684\u8bbe\u5907\u4e0a&#xff0c;\u8981\u7ed8\u5236\u4e00\u6761 1 \u7269\u7406\u50cf\u7d20\u5bbd\u7684\u8fb9\u6846&#xff0c;\u903b\u8f91\u50cf\u7d20\u5bbd\u5ea6\u5e94\u8be5\u8bbe\u7f6e\u4e3a&#xff1a;<\/p>\n<p>A. 1.0 B. 0.8 C. 1.25 D. 2.0<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;B<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u7269\u7406\u50cf\u7d20\u5bbd\u5ea6 &#061; \u903b\u8f91\u50cf\u7d20\u5bbd\u5ea6 \u00d7 devicePixelRatio\u3002\u8981\u5f97\u5230 1 \u7269\u7406\u50cf\u7d20&#xff0c;\u903b\u8f91\u50cf\u7d20\u5bbd\u5ea6 &#061; 1 \/ 1.25 &#061; 0.8\u3002\u5728 DPR \u4e3a 1 \u7684\u8bbe\u5907\u4e0a&#xff0c;1 \u903b\u8f91\u50cf\u7d20\u6070\u597d\u662f 1 \u7269\u7406\u50cf\u7d20&#xff1b;\u5728 DPR \u4e3a 2 \u7684\u8bbe\u5907\u4e0a&#xff0c;1 \u903b\u8f91\u50cf\u7d20\u662f 2 \u7269\u7406\u50cf\u7d20&#xff0c;\u8981\u5f97\u5230 1 \u7269\u7406\u50cf\u7d20\u9700\u8981 0.5 \u903b\u8f91\u50cf\u7d20\u3002\u76f4\u63a5\u5199 1.0 \u903b\u8f91\u50cf\u7d20\u5728\u5206\u6570 DPR \u4e0b\u4f1a\u4ea7\u751f\u6a21\u7cca\u6216\u88c1\u526a&#xff0c;\u56e0\u4e3a 1 \u00d7 1.25 &#061; 1.25 \u7269\u7406\u50cf\u7d20\u4e0d\u662f\u6574\u6570\u3002<\/p>\n<h4>\u4e60\u989810&#xff08;\u591a\u9009&#xff09;<\/h4>\n<p>\u4ee5\u4e0b\u54ea\u4e9b\u63aa\u65bd\u53ef\u4ee5\u6709\u6548\u964d\u4f4e\u56fa\u5b9a\u9ad8\u5ea6\u6587\u672c\u5bb9\u5668\u5728\u5b57\u4f53\u7f29\u653e\u4e0b\u7684\u5e03\u5c40\u98ce\u9669&#xff1f;<\/p>\n<p>A. \u7528 ConstrainedBox(minHeight:) \u66ff\u4ee3 SizedBox(height:) B. \u5728 ListView \u4e2d\u907f\u514d\u4f7f\u7528\u56fa\u5b9a\u7684 itemExtent&#xff0c;\u8ba9\u5217\u8868\u9879\u9ad8\u5ea6\u7531\u5185\u5bb9\u51b3\u5b9a C. \u5bf9\u5305\u542b\u6587\u672c\u7684\u5bb9\u5668\u8bbe\u7f6e clipBehavior: Clip.hardEdge \u6765\u88c1\u526a\u6ea2\u51fa D. \u7528 TextScaler.clamp \u9650\u5236\u5168\u5c40\u5b57\u4f53\u7f29\u653e\u8303\u56f4\u4f5c\u4e3a\u6700\u540e\u624b\u6bb5<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;A\u3001B\u3001D<\/p>\n<p>\u89e3\u8bfb&#xff1a; A \u662f\u76f4\u63a5\u7684\u4fee\u590d&#xff1a;ConstrainedBox \u63d0\u4f9b\u6700\u5c0f\u9ad8\u5ea6\u800c\u4e0d\u662f\u56fa\u5b9a\u9ad8\u5ea6&#xff0c;\u5141\u8bb8\u5bb9\u5668\u5728\u6587\u672c\u7f29\u653e\u65f6\u6269\u5c55\u3002B \u662f\u6b63\u786e\u7684&#xff1a;\u56fa\u5b9a\u7684 itemExtent \u4f1a\u4e0e\u6587\u672c\u7f29\u653e\u540e\u7684\u5b9e\u9645\u9ad8\u5ea6\u4e0d\u5339\u914d&#xff0c;\u5bfc\u81f4\u88c1\u526a\u6216\u5217\u8868\u8df3\u52a8&#xff1b;\u8ba9 ListView \u81ea\u884c\u6d4b\u91cf\u5b50\u9879\u9ad8\u5ea6\u53ef\u4ee5\u907f\u514d\u8fd9\u4e2a\u7ea7\u8054\u95ee\u9898\u3002D \u662f\u6b63\u786e\u7684&#xff1a;TextScaler.clamp \u53ef\u4ee5\u4f5c\u4e3a\u201c\u5e03\u5c40\u5df2\u7ecf\u5f39\u6027\u5316\u4f46\u4ecd\u65e0\u6cd5\u5bb9\u7eb3\u6781\u7aef\u7f29\u653e\u201d\u65f6\u7684\u7a84\u573a\u666f\u515c\u5e95&#xff0c;\u4f46\u5b83\u4e0d\u662f\u9996\u9009\u65b9\u6848&#xff0c;\u56e0\u4e3a\u5b83\u4e0e\u65e0\u969c\u788d\u8bbe\u7f6e\u5bf9\u6297\u3002C \u662f\u9519\u8bef\u7684&#xff1a;Clip.hardEdge \u53ea\u662f\u628a\u201c\u6587\u672c\u6ea2\u51fa\u201d\u53d8\u6210\u4e86\u201c\u6587\u672c\u88ab\u65e0\u58f0\u88c1\u526a\u201d&#xff0c;\u5b83\u6ca1\u6709\u89e3\u51b3\u201c\u5bb9\u5668\u9ad8\u5ea6\u4e0d\u8db3\u201d\u7684\u6839\u672c\u95ee\u9898&#xff1b;\u7528\u6237\u770b\u4e0d\u5230\u5b8c\u6574\u7684\u6587\u672c&#xff0c;\u529f\u80fd\u5728\u65e0\u969c\u788d\u8bbe\u7f6e\u4e0b\u4ecd\u7136\u4e0d\u53ef\u7528\u3002<\/p>\n<h4>\u4e60\u989811&#xff08;\u5224\u65ad&#xff09;<\/h4>\n<p>Expanded \u548c FractionallySizedBox \u90fd\u53ef\u4ee5\u8ba9\u5b50\u7ec4\u4ef6\u5728\u7236\u7ea7\u7a7a\u95f4\u4e2d\u6309\u6bd4\u4f8b\u5206\u914d\u5c3a\u5bf8&#xff0c;\u56e0\u6b64\u5b83\u4eec\u53ef\u4ee5\u5b8c\u5168\u4e92\u6362\u4f7f\u7528\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a;\u9519\u8bef<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u4e24\u8005\u5728\u8bed\u4e49\u548c\u9002\u7528\u573a\u666f\u4e0a\u6709\u672c\u8d28\u533a\u522b\u3002Expanded \u662f Flex \u7684\u5b50\u7ec4\u4ef6&#xff0c;\u7528\u4e8e\u5728 Row\/Column \u7684\u4e3b\u8f74\u4e0a\u5206\u914d\u5269\u4f59\u7a7a\u95f4&#xff0c;\u5b83\u5f3a\u5236\u5b50\u7ec4\u4ef6\u586b\u6ee1\u5206\u914d\u5230\u7684\u7a7a\u95f4&#xff08;FlexFit.tight&#xff09;\u3002FractionallySizedBox \u662f\u4e00\u4e2a\u72ec\u7acb\u7684 Widget&#xff0c;\u5b83\u6839\u636e\u7236\u7ea7\u7684\u6700\u5927\u7ea6\u675f\u6309\u6bd4\u4f8b\u8bbe\u7f6e\u5b50\u7ec4\u4ef6\u7684\u5c3a\u5bf8&#xff0c;\u4e0d\u4f9d\u8d56\u4e8e Flex \u7684\u5269\u4f59\u7a7a\u95f4\u5206\u914d&#xff0c;\u53ef\u4ee5\u7528\u4e8e\u4efb\u4f55\u6709\u7ea6\u675f\u7684\u7236\u7ea7\u3002Expanded \u53ea\u80fd\u7528\u4e8e Flex \u7684\u76f4\u63a5\u5b50\u7ea7&#xff1b;FractionallySizedBox \u53ef\u4ee5\u7528\u4e8e\u66f4\u4e00\u822c\u7684\u5e03\u5c40\u4e2d\u3002\u4e24\u8005\u4e0d\u80fd\u4e92\u6362&#xff0c;\u9009\u62e9\u53d6\u51b3\u4e8e\u201c\u662f\u5426\u9700\u8981 Flex \u7684\u5269\u4f59\u7a7a\u95f4\u5206\u914d\u8bed\u4e49\u201d\u8fd8\u662f\u201c\u662f\u5426\u53ea\u9700\u8981\u57fa\u4e8e\u7236\u7ea7\u7ea6\u675f\u7684\u767e\u5206\u6bd4\u5c3a\u5bf8\u201d\u3002<\/p>\n<h4>\u4e60\u989812&#xff08;\u573a\u666f\u5206\u6790&#xff09;<\/h4>\n<p>\u4e00\u4e2a Row \u4e2d\u5305\u542b\u4e00\u4e2a Icon \u548c\u4e00\u4e2a Text\u3002\u5728\u9ed8\u8ba4\u5b57\u4f53\u4e0b&#xff0c;Text \u548c Icon \u5e76\u6392\u663e\u793a\u6b63\u5e38\u3002\u7528\u6237\u5c06\u5b57\u4f53\u653e\u5927\u5230 150% \u540e&#xff0c;Text \u53d8\u5bbd&#xff0c;Row \u6ea2\u51fa\u3002\u8bf7\u7ed9\u51fa\u81f3\u5c11\u4e24\u79cd\u4fee\u590d\u65b9\u6848&#xff0c;\u5e76\u8bf4\u660e\u5b83\u4eec\u7684\u8bed\u4e49\u5dee\u5f02\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a; \u65b9\u6848\u4e00&#xff1a;\u7528 Expanded \u6216 Flexible \u5305\u88f9 Text&#xff0c;\u5e76\u8bbe\u7f6e overflow: TextOverflow.ellipsis\u3002Expanded \u5f3a\u5236 Text \u586b\u6ee1 Icon \u4e4b\u5916\u7684\u5269\u4f59\u5bbd\u5ea6&#xff0c;ellipsis \u5728\u6709\u754c\u5bbd\u5ea6\u5185\u622a\u65ad\u8fc7\u957f\u7684\u6587\u672c&#xff1b;\u9002\u5408\u201c\u6587\u672c\u5e94\u8be5\u5360\u636e\u5269\u4f59\u7a7a\u95f4&#xff0c;\u8fc7\u957f\u65f6\u53ef\u4ee5\u622a\u65ad\u201d\u7684\u573a\u666f\u3002\u65b9\u6848\u4e8c&#xff1a;\u7528 Flexible \u5305\u88f9 Text&#xff0c;\u4e0d\u5f3a\u5236\u586b\u6ee1&#xff0c;Text \u5728\u5185\u5bb9\u8f83\u77ed\u65f6\u4fdd\u6301\u81ea\u7136\u5bbd\u5ea6&#xff0c;\u5728\u8d85\u51fa\u65f6\u88ab\u538b\u7f29&#xff1b;\u9002\u5408\u201c\u6587\u672c\u5bbd\u5ea6\u4e0d\u786e\u5b9a\u3001\u4e0d\u9700\u8981\u5f3a\u5236\u62c9\u4f38\u201d\u7684\u573a\u666f\u3002\u65b9\u6848\u4e09&#xff1a;\u5c06 Row \u66ff\u6362\u4e3a Wrap&#xff0c;\u5141\u8bb8 Text \u5728\u5bbd\u5ea6\u4e0d\u8db3\u65f6\u6362\u5230\u4e0b\u4e00\u884c&#xff1b;\u9002\u5408\u201c\u6362\u884c\u662f\u8bbe\u8ba1\u5141\u8bb8\u7684\u201d\u573a\u666f\u3002\u4e09\u79cd\u65b9\u6848\u7684\u8bed\u4e49\u4e0d\u540c&#xff1a;Expanded \u548c Flexible \u4fdd\u6301\u5355\u884c\u3001\u8c03\u6574\u5bbd\u5ea6\u5206\u914d&#xff1b;Wrap \u653e\u5f03\u5355\u884c\u3001\u5141\u8bb8\u6362\u884c\u3002<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u8fd9\u4e2a\u6848\u4f8b\u7684\u4fee\u590d\u5de5\u5177\u4e0e\u7b2c8\u8bfe\u201cFlex \u6ea2\u51fa\u201d\u7684\u5de5\u5177\u6709\u91cd\u53e0&#xff0c;\u4f46\u6839\u56e0\u4e0d\u540c&#xff1a;\u7b2c8\u8bfe\u7684\u6ea2\u51fa\u662f\u201c\u7ea6\u675f\u534f\u5546\u5931\u8d25\u201d&#xff0c;\u8fd9\u91cc\u7684\u6ea2\u51fa\u662f\u201c\u6587\u672c\u7f29\u653e\u5bfc\u81f4\u5185\u5bb9\u56fa\u6709\u5bbd\u5ea6\u53d8\u5316\u201d\u3002\u4fee\u590d\u7684\u6838\u5fc3\u662f\u8ba9\u6587\u672c\u5728\u6709\u754c\u5bbd\u5ea6\u5185\u51b3\u5b9a\u81ea\u5df1\u7684\u5e03\u5c40\u7b56\u7565&#xff08;\u622a\u65ad\u3001\u6362\u884c\u6216\u538b\u7f29&#xff09;&#xff0c;\u800c\u4e0d\u662f\u8ba9\u6587\u672c\u6309\u7167\u653e\u5927\u540e\u7684\u56fa\u6709\u5bbd\u5ea6\u65e0\u7ea6\u675f\u5730\u4f38\u5c55\u3002<\/p>\n<h4>\u4e60\u989813&#xff08;\u7b80\u7b54&#xff09;<\/h4>\n<p>\u8bf7\u89e3\u91ca\u4e3a\u4ec0\u4e48\u201c\u903b\u8f91\u50cf\u7d20\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u89c6\u89c9\u5927\u5c0f\u5927\u81f4\u76f8\u540c\u201d\u8fd9\u4e00\u7279\u6027&#xff0c;\u5e76\u4e0d\u80fd\u4fdd\u8bc1\u56fa\u5b9a\u5c3a\u5bf8\u7684\u5e03\u5c40\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u770b\u8d77\u6765\u201c\u6bd4\u4f8b\u76f8\u540c\u201d\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a; \u903b\u8f91\u50cf\u7d20\u7684\u8bbe\u8ba1\u76ee\u6807\u662f\u201c\u89c6\u89c9\u5c3a\u5bf8\u7684\u4e00\u81f4\u6027\u201d&#xff1a;100 \u903b\u8f91\u50cf\u7d20\u5728\u624b\u673a\u3001\u5e73\u677f\u3001\u684c\u9762\u663e\u793a\u5668\u4e0a\u5927\u81f4\u770b\u8d77\u6765\u4e00\u6837\u5927&#xff08;\u7ea6 1 \u5398\u7c73\u5de6\u53f3&#xff0c;\u5b98\u65b9\u5b9a\u4e49\u662f\u5927\u7ea6\u6bcf\u5398\u7c73 38 \u903b\u8f91\u50cf\u7d20&#xff0c;\u6216\u6bcf\u82f1\u5bf8 96 \u903b\u8f91\u50cf\u7d20&#xff09;\u3002\u4f46\u201c\u89c6\u89c9\u5927\u5c0f\u76f8\u540c\u201d\u4e0d\u7b49\u4e8e\u201c\u5728\u5e03\u5c40\u4e2d\u5360\u7684\u6bd4\u4f8b\u76f8\u540c\u201d\u3002\u4e00\u4e2a 100 \u903b\u8f91\u50cf\u7d20\u5bbd\u7684\u6309\u94ae&#xff0c;\u5728 320 \u903b\u8f91\u50cf\u7d20\u5bbd\u7684\u5c0f\u5c4f\u4e0a\u5360 31%&#xff0c;\u5728 1024 \u903b\u8f91\u50cf\u7d20\u5bbd\u7684\u5e73\u677f\u4e0a\u5360\u4e0d\u5230 10%\u3002\u5e03\u5c40\u7684\u6bd4\u4f8b\u611f\u53d6\u51b3\u4e8e\u56fa\u5b9a\u5c3a\u5bf8\u4e0e\u53ef\u7528\u7a7a\u95f4\u7684\u5173\u7cfb&#xff0c;\u800c\u903b\u8f91\u50cf\u7d20\u7684\u6570\u503c\u4e0d\u643a\u5e26\u201c\u53ef\u7528\u7a7a\u95f4\u201d\u7684\u4fe1\u606f\u3002\u56fa\u5b9a\u5c3a\u5bf8\u7684\u5e03\u5c40\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a&#xff0c;\u89c6\u89c9\u5143\u7d20\u7684\u7edd\u5bf9\u5927\u5c0f\u53ef\u80fd\u5927\u81f4\u76f8\u540c&#xff0c;\u4f46\u5b83\u4eec\u4e4b\u95f4\u7684\u76f8\u5bf9\u6bd4\u4f8b\u4f1a\u968f\u53ef\u7528\u7a7a\u95f4\u7684\u53d8\u5316\u800c\u53d8\u5316&#xff0c;\u5bfc\u81f4\u201c\u5728\u624b\u673a\u4e0a\u770b\u8d77\u6765\u6b63\u5e38\u7684\u95f4\u8ddd&#xff0c;\u5728\u5e73\u677f\u4e0a\u663e\u5f97\u6781\u5176\u62e5\u6324\u201d\u6216\u53cd\u4e4b\u3002<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u8fd9\u4e2a\u533a\u5206\u662f\u7406\u89e3\u201c\u4e3a\u4ec0\u4e48\u903b\u8f91\u50cf\u7d20\u7684\u8de8\u8bbe\u5907\u4e00\u81f4\u6027\u4e0d\u80fd\u66ff\u4ee3\u54cd\u5e94\u5f0f\u5e03\u5c40\u201d\u7684\u5173\u952e\u3002\u903b\u8f91\u50cf\u7d20\u89e3\u51b3\u7684\u662f\u201c\u7269\u7406\u5c3a\u5bf8\u7684\u4e00\u81f4\u6027\u201d&#xff0c;\u54cd\u5e94\u5f0f\u5e03\u5c40\u89e3\u51b3\u7684\u662f\u201c\u5e03\u5c40\u7ed3\u6784\u4e0e\u53ef\u7528\u7a7a\u95f4\u7684\u5173\u7cfb\u201d\u3002\u4e24\u8005\u662f\u4e0d\u540c\u5c42\u9762\u7684\u95ee\u9898&#xff0c;\u56fa\u5b9a\u5c3a\u5bf8\u53ef\u4ee5\u5728\u903b\u8f91\u50cf\u7d20\u5c42\u9762\u662f\u201c\u6b63\u786e\u201d\u7684&#xff0c;\u540c\u65f6\u5728\u5e03\u5c40\u6bd4\u4f8b\u5c42\u9762\u662f\u201c\u9519\u4e71\u201d\u7684\u3002<\/p>\n<h4>\u4e60\u989814&#xff08;\u573a\u666f\u8bbe\u8ba1&#xff09;<\/h4>\n<p>\u56e2\u961f\u7684\u4e00\u4e2a Flutter \u9879\u76ee\u5728\u624b\u673a\u548c\u5e73\u677f\u4e0a\u90fd\u51fa\u73b0\u4e86\u5e03\u5c40\u95ee\u9898&#xff1a;\u624b\u673a\u4e0a\u90e8\u5206\u6587\u672c\u88ab\u88c1\u526a&#xff0c;\u5e73\u677f\u4e0a\u5361\u7247\u8fc7\u7a84\u3001\u7559\u767d\u8fc7\u591a\u3002\u4ee3\u7801\u4e2d\u5927\u91cf\u4f7f\u7528 width: 300\u3001height: 100\u3001fontSize: 16\u3002\u8bf7\u8bbe\u8ba1\u4e00\u5957\u6cbb\u7406\u65b9\u6848&#xff0c;\u8986\u76d6\u201c\u6b62\u8840\u201d\u201c\u7b5b\u67e5\u201d\u201c\u4fee\u590d\u201d\u201c\u9884\u9632\u201d\u56db\u4e2a\u5c42\u9762\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a; \u6b62\u8840\u5c42\u9762&#xff1a; \u5728 CI \u7684 Widget \u6d4b\u8bd5\u4e2d\u52a0\u5165 TextScaler.linear(2.0) \u7684\u622a\u56fe\u5bf9\u6bd4&#xff0c;\u4efb\u4f55\u6587\u672c\u88ab\u88c1\u526a\u7684\u9875\u9762\u7acb\u5373\u5931\u8d25&#xff1b;\u540c\u65f6\u5bf9 width\/height \u5b57\u9762\u91cf\u505a\u9759\u6001\u641c\u7d22&#xff0c;\u5c06\u65b0\u589e\u7684\u786c\u7f16\u7801\u5c3a\u5bf8\u4f5c\u4e3a code review \u7684\u5fc5\u67e5\u9879\u3002\u7b5b\u67e5\u5c42\u9762&#xff1a; \u7528 LayoutBuilder \u7684 constraints.maxWidth &lt; 600 \u4f5c\u4e3a\u65ad\u70b9&#xff0c;\u8bc6\u522b\u54ea\u4e9b\u9875\u9762\u5728\u5e73\u677f\u5bbd\u5ea6\u4e0b\u4ecd\u7136\u4f7f\u7528\u5355\u5217\u5e03\u5c40&#xff1b;\u7528 DevTools \u68c0\u67e5\u6bcf\u4e2a\u62a5\u9519 Widget \u7684\u7236\u7ea7\u7ea6\u675f&#xff0c;\u533a\u5206\u201c\u5c4f\u5e55\u5c3a\u5bf8\u95ee\u9898\u201d\u548c\u201c\u5c40\u90e8\u53ef\u7528\u7a7a\u95f4\u95ee\u9898\u201d&#xff1b;\u6807\u8bb0\u6240\u6709\u5305\u542b\u6587\u672c\u7684\u56fa\u5b9a\u9ad8\u5ea6\u5bb9\u5668\u3002\u4fee\u590d\u5c42\u9762&#xff1a; \u6587\u672c\u5bb9\u5668\u4ece SizedBox(height:) \u6539\u4e3a ConstrainedBox(minHeight:)&#xff1b;\u53c2\u4e0e Row\/Column \u7684\u56fa\u5b9a\u5bbd\u5ea6\u6539\u4e3a Expanded\/Flexible\/FractionallySizedBox&#xff1b;\u5e73\u677f\u4e0a\u9700\u8981\u591a\u5217\u7684\u5e03\u5c40\u7528 LayoutBuilder &#043; \u65ad\u70b9\u5206\u652f&#xff1b;fontSize \u7ed1\u5b9a\u5230 Theme.of(context).textTheme \u800c\u4e0d\u662f\u5b57\u9762\u91cf&#xff0c;\u8ba9\u5b57\u4f53\u7f29\u653e\u6709\u8bed\u4e49\u57fa\u7840\u3002\u9884\u9632\u5c42\u9762&#xff1a; \u5728\u56e2\u961f\u89c4\u8303\u4e2d\u5efa\u7acb\u201c\u5f39\u6027\u7ea6\u675f\u4f18\u5148\u201d\u7684\u539f\u5219&#xff0c;\u56fa\u5b9a\u5c3a\u5bf8\u9700\u8981\u53ef\u9648\u8ff0\u7684\u8bed\u4e49\u7406\u7531&#xff1b;\u5728 CI \u4e2d\u914d\u7f6e\u591a\u8bbe\u5907\u5c3a\u5bf8\u7684 Widget \u6d4b\u8bd5&#xff08;\u81f3\u5c11\u8986\u76d6 320\u3001360\u3001600\u30011024 \u903b\u8f91\u50cf\u7d20\u5bbd&#xff09;\u548c TextScaler 1.0\/1.5\/2.0 \u7684\u622a\u56fe\u6d4b\u8bd5&#xff1b;\u5bf9 devicePixelRatio \u7684\u7269\u7406\u50cf\u7d20\u610f\u56fe\u4f7f\u7528 1 \/ dpr \u800c\u4e0d\u662f\u5b57\u9762\u91cf\u3002<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u8fd9\u4e2a\u6cbb\u7406\u65b9\u6848\u4e0e\u7b2c4\u8bfe\u3001\u7b2c6\u8bfe\u7684\u6cbb\u7406\u903b\u8f91\u540c\u6784&#xff1a;\u5148\u8ba9\u65b0\u95ee\u9898\u65e0\u6cd5\u8fdb\u5165&#xff08;CI \u95e8\u7981&#xff09;&#xff0c;\u518d\u8ba9\u5df2\u6709\u95ee\u9898\u53d8\u5f97\u53ef\u89c1&#xff08;\u7ea6\u675f\u68c0\u67e5\u3001\u9759\u6001\u641c\u7d22&#xff09;&#xff0c;\u7136\u540e\u6309\u98ce\u9669\u4f18\u5148\u7ea7\u6e10\u8fdb\u4fee\u590d&#xff08;\u6587\u672c\u5bb9\u5668\u4f18\u5148\u4e8e\u88c5\u9970\u6027\u5c3a\u5bf8&#xff09;&#xff0c;\u6700\u540e\u7528\u89c4\u8303\u548c\u591a\u8bbe\u5907\u6d4b\u8bd5\u9884\u9632\u590d\u53d1\u3002\u5c3a\u5bf8\u786c\u7f16\u7801\u7684\u6cbb\u7406\u5c24\u5176\u9700\u8981\u6ce8\u610f\u201c\u4e0d\u662f\u6240\u6709\u56fa\u5b9a\u5c3a\u5bf8\u90fd\u662f\u9519\u7684\u201d&#xff1a;\u6709\u8bed\u4e49\u7684\u89e6\u6478\u76ee\u6807\u3001\u56fe\u6807\u5c3a\u5bf8\u5e94\u8be5\u88ab\u4fdd\u7559&#xff0c;\u4f46\u5e94\u8be5\u88ab\u547d\u540d\u4e3a\u5e38\u91cf\u5e76\u63a5\u53d7\u5ba1\u67e5&#xff1b;\u65e0\u8bed\u4e49\u7684\u6570\u503c\u786c\u7f16\u7801\u624d\u662f\u4fee\u590d\u7684\u76ee\u6807\u3002<\/p>\n<h4>\u4e60\u989815&#xff08;\u7b80\u7b54&#xff09;<\/h4>\n<p>\u8bf7\u6bd4\u8f83 MediaQuery.sizeOf\u3001LayoutBuilder \u548c FractionallySizedBox \u4e09\u79cd\u5c3a\u5bf8\u51b3\u7b56\u5de5\u5177\u5728\u201c\u51b3\u7b56\u4f9d\u636e\u201d\u548c\u201c\u9002\u7528\u573a\u666f\u201d\u4e0a\u7684\u5dee\u5f02\u3002<\/p>\n<p>\u53c2\u8003\u7b54\u6848&#xff1a; MediaQuery.sizeOf &#xff1a;\u51b3\u7b56\u4f9d\u636e\u662f\u5e94\u7528\u6574\u4e2a\u5c4f\u5e55&#xff08;\u6216\u7a97\u53e3&#xff09;\u7684\u5c3a\u5bf8\u3002\u9002\u7528\u573a\u666f&#xff1a;\u57fa\u4e8e\u6574\u4e2a\u5e94\u7528\u7a97\u53e3\u7684\u5c3a\u5bf8\u9009\u62e9 UI \u6a21\u5f0f&#xff08;\u4f8b\u5982\u5c0f\u7a97\u53e3\u7528\u5e95\u90e8\u5bfc\u822a&#xff0c;\u5927\u7a97\u53e3\u7528\u5bfc\u822a rail&#xff09;&#xff1b;\u9700\u8981\u6839\u636e\u8bbe\u5907\u7a97\u53e3\u7684\u5168\u5c40\u5c3a\u5bf8\u505a\u65ad\u70b9\u5206\u652f\u3002LayoutBuilder &#xff1a;\u51b3\u7b56\u4f9d\u636e\u662f\u7236\u7ea7\u7ed9\u5f53\u524d Widget \u7684\u5e03\u5c40\u7ea6\u675f&#xff08;BoxConstraints&#xff0c;\u5305\u542b\u6700\u5c0f\/\u6700\u5927\u5bbd\u9ad8&#xff09;\u3002\u9002\u7528\u573a\u666f&#xff1a;\u5e03\u5c40\u9700\u8981\u57fa\u4e8e\u201c\u8fd9\u4e2a Widget \u5b9e\u9645\u6709\u591a\u5c11\u53ef\u7528\u7a7a\u95f4\u201d\u6765\u51b3\u5b9a\u5c3a\u5bf8\u6216\u7ed3\u6784&#xff1b;Widget \u4f4d\u4e8e Padding\u3001Drawer\u3001Expanded \u7b49\u53d7\u7ea6\u675f\u7684\u5c40\u90e8\u4e2d\u3002FractionallySizedBox &#xff1a;\u51b3\u7b56\u4f9d\u636e\u662f\u7236\u7ea7\u7684\u6700\u5927\u7ea6\u675f&#xff0c;\u6309\u6bd4\u4f8b\u8bbe\u7f6e\u5b50\u7ec4\u4ef6\u5c3a\u5bf8\u3002\u9002\u7528\u573a\u666f&#xff1a;\u5b50\u7ec4\u4ef6\u5e94\u8be5\u662f\u7236\u7ea7\u53ef\u7528\u7a7a\u95f4\u7684\u4e00\u4e2a\u56fa\u5b9a\u6bd4\u4f8b&#xff08;\u4f8b\u5982 50% \u5bbd\u300130% \u9ad8&#xff09;&#xff0c;\u4f46\u4e0d\u9700\u8981\u6839\u636e\u65ad\u70b9\u6539\u53d8\u5e03\u5c40\u7ed3\u6784\u3002<\/p>\n<p>\u4e09\u8005\u7684\u5c42\u6b21\u4e0d\u540c&#xff1a;MediaQuery.sizeOf \u662f\u201c\u5168\u5c40\u89c6\u56fe\u201d&#xff0c;LayoutBuilder \u662f\u201c\u5c40\u90e8\u7ea6\u675f\u89c6\u56fe\u201d&#xff0c;FractionallySizedBox \u662f\u201c\u57fa\u4e8e\u5c40\u90e8\u7ea6\u675f\u7684\u6bd4\u4f8b\u5206\u914d\u201d\u3002\u5728\u540c\u4e00\u4e2a\u5e03\u5c40\u4e2d&#xff0c;\u5b83\u4eec\u53ef\u4ee5\u7ec4\u5408\u4f7f\u7528&#xff1a;LayoutBuilder \u51b3\u5b9a\u65ad\u70b9\u5206\u652f&#xff0c;FractionallySizedBox \u51b3\u5b9a\u5206\u652f\u5185\u67d0\u4e2a\u5b50\u7ec4\u4ef6\u7684\u6bd4\u4f8b\u5c3a\u5bf8&#xff0c;MediaQuery.sizeOf \u53ef\u80fd\u7528\u4e8e\u5bfc\u822a\u5c42\u51b3\u5b9a\u6574\u4f53 UI \u6a21\u5f0f\u3002<\/p>\n<p>\u89e3\u8bfb&#xff1a; \u8fd9\u4e2a\u5bf9\u6bd4\u7684\u6838\u5fc3\u662f\u5c3a\u5bf8\u51b3\u7b56\u7684\u201c\u53c2\u7167\u7cfb\u201d \u3002\u786c\u7f16\u7801\u5c3a\u5bf8\u7684\u95ee\u9898\u4e4b\u4e00\u662f\u201c\u6ca1\u6709\u53c2\u7167\u7cfb\u201d\u2014\u2014width: 300 \u4e0d\u544a\u8bc9\u4efb\u4f55\u4eba\u5b83\u662f\u76f8\u5bf9\u4e8e\u4ec0\u4e48\u800c\u8a00\u7684\u3002\u9009\u62e9\u6b63\u786e\u7684\u5de5\u5177&#xff0c;\u5c31\u662f\u9009\u62e9\u6b63\u786e\u7684\u53c2\u7167\u7cfb&#xff1a;\u5c4f\u5e55\u3001\u7236\u7ea7\u7ea6\u675f\u3001\u8fd8\u662f\u7236\u7ea7\u7ea6\u675f\u7684\u6bd4\u4f8b\u3002\u5de5\u5177\u7684\u9009\u62e9\u5e94\u8be5\u7531\u201c\u8fd9\u4e2a\u5c3a\u5bf8\u5e94\u8be5\u8ddf\u968f\u4ec0\u4e48\u53d8\u5316\u201d\u51b3\u5b9a&#xff0c;\u800c\u4e0d\u662f\u7531\u201c\u54ea\u4e2a\u5de5\u5177\u770b\u8d77\u6765\u66f4\u9ad8\u7ea7\u201d\u51b3\u5b9a\u3002<\/p>\n<h3>\u516b\u3001\u672c\u8282\u8bfe\u77e5\u8bc6\u8981\u70b9\u603b\u7ed3<\/h3>\n<li>\n<p>\u5c3a\u5bf8\u786c\u7f16\u7801\u7684\u6545\u969c\u662f\u5206\u6563\u7684\u3001\u7d2f\u79ef\u7684&#xff1a;\u5b83\u4e0d\u96c6\u4e2d\u5728\u67d0\u4e00\u5904\u5d29\u6e83&#xff0c;\u800c\u662f\u5728\u8bbe\u5907\u3001\u5b57\u4f53\u7f29\u653e\u6216\u7a97\u53e3\u5c3a\u5bf8\u53d8\u5316\u65f6&#xff0c;\u8ba9\u51e0\u5341\u4e2a\u56fa\u5b9a\u6570\u503c\u540c\u65f6\u5931\u914d\u3002\u5b83\u7684\u672c\u8d28\u662f\u7528\u201c\u6570\u503c\u786e\u5b9a\u6027\u201d\u66ff\u4ee3\u4e86\u201c\u7ea6\u675f\u534f\u5546\u201d \u3002<\/p>\n<\/li>\n<li>\n<p>MediaQuery.size \u8fd4\u56de\u903b\u8f91\u50cf\u7d20&#xff0c;\u4e0d\u662f\u7269\u7406\u50cf\u7d20\u3002\u903b\u8f91\u50cf\u7d20\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u89c6\u89c9\u5927\u5c0f\u5927\u81f4\u76f8\u540c&#xff0c;\u4f46\u4e0d\u643a\u5e26\u6bd4\u4f8b\u4fe1\u606f&#xff1b;\u56fa\u5b9a\u5c3a\u5bf8\u7684\u5e03\u5c40\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a&#xff0c;\u89c6\u89c9\u5143\u7d20\u7684\u7edd\u5bf9\u5927\u5c0f\u53ef\u80fd\u4e00\u81f4&#xff0c;\u4f46\u76f8\u5bf9\u6bd4\u4f8b\u4f1a\u968f\u53ef\u7528\u7a7a\u95f4\u53d8\u5316\u800c\u9519\u4e71\u3002<\/p>\n<\/li>\n<li>\n<p>\u201c\u4f2a\u52a8\u6001\u8ba1\u7b97\u201d\u4ecd\u7136\u662f\u786c\u7f16\u7801\u3002screenHeight \/ 3.55 \u53ea\u662f\u628a\u56fa\u5b9a\u6570\u503c\u6362\u6210\u4e86\u56fa\u5b9a\u6bd4\u4f8b&#xff0c;\u5b83\u4e0d\u4e0e\u5185\u5bb9\u3001\u53ef\u7528\u5bbd\u5ea6\u3001\u5b57\u4f53\u7f29\u653e\u6216\u5b89\u5168\u533a\u534f\u5546\u3002\u5bbd\u5ea6\u7684\u8ba1\u7b97\u751a\u81f3\u53ef\u80fd\u9519\u8bef\u5730\u4f7f\u7528\u5c4f\u5e55\u9ad8\u5ea6\u4f5c\u4e3a\u5206\u6bcd&#xff0c;\u5728\u6a2a\u7ad6\u5c4f\u6216\u4e0d\u540c\u5bbd\u9ad8\u6bd4\u4e0b\u4ea7\u751f\u65e0\u5173\u7ed3\u679c\u3002<\/p>\n<\/li>\n<li>\n<p>\u6587\u672c\u7f29\u653e\u662f\u4e00\u4e2a\u4e0e\u5c4f\u5e55\u5c3a\u5bf8\u6b63\u4ea4\u7684\u7ef4\u5ea6\u3002TextScaler \u53ef\u4ee5\u5728\u4e0d\u6539\u53d8\u5c4f\u5e55\u5c3a\u5bf8\u7684\u60c5\u51b5\u4e0b&#xff0c;\u8ba9\u6587\u672c\u6491\u7834\u56fa\u5b9a\u9ad8\u5ea6\u7684\u5bb9\u5668\u3001\u88c1\u526a\u6309\u94ae\u6587\u5b57\u3001\u6216\u5c06\u5173\u952e\u64cd\u4f5c\u63a8\u51fa\u5c4f\u5e55\u3002ConstrainedBox(minHeight:) \u5141\u8bb8\u5bb9\u5668\u5728\u6587\u672c\u7f29\u653e\u65f6\u6269\u5c55&#xff1b;SizedBox(height:) \u4e0d\u5141\u8bb8\u3002<\/p>\n<\/li>\n<li>\n<p>MediaQuery.sizeOf \u8fd4\u56de\u5e94\u7528\u6574\u4e2a\u5c4f\u5e55\u7684\u5c3a\u5bf8&#xff0c;LayoutBuilder \u8fd4\u56de\u7236\u7ea7\u7ed9\u5f53\u524d Widget \u7684\u7ea6\u675f\u3002MediaQuery.sizeOf \u9002\u5408\u5168\u5c40 UI \u6a21\u5f0f\u51b3\u7b56&#xff1b;LayoutBuilder \u9002\u5408\u5c40\u90e8\u5c3a\u5bf8\u548c\u65ad\u70b9\u5206\u652f&#xff1b;FractionallySizedBox \u9002\u5408\u57fa\u4e8e\u7236\u7ea7\u7ea6\u675f\u7684\u6bd4\u4f8b\u5206\u914d\u3002<\/p>\n<\/li>\n<li>\n<p>devicePixelRatio \u662f\u7269\u7406\u50cf\u7d20\u4e0e\u903b\u8f91\u50cf\u7d20\u4e4b\u95f4\u7684\u8f6c\u6362\u56e0\u5b50&#xff0c;\u53ef\u80fd\u5728\u8fd0\u884c\u65f6\u53d8\u5316\u3002\u5927\u591a\u6570\u5e03\u5c40\u4f7f\u7528\u903b\u8f91\u50cf\u7d20\u5373\u53ef&#xff1b;\u53ea\u6709\u5f53\u610f\u56fe\u662f\u201c\u7269\u7406\u50cf\u7d20\u7ea7\u7cbe\u5ea6\u201d&#xff08;1px \u8fb9\u6846\u3001\u50cf\u7d20\u5bf9\u9f50&#xff09;\u65f6&#xff0c;\u624d\u4f7f\u7528 1 \/ devicePixelRatio \u8ba1\u7b97\u903b\u8f91\u50cf\u7d20\u5bbd\u5ea6\u3002\u4e0d\u8981\u7f13\u5b58 devicePixelRatio&#xff0c;\u8ba9 MediaQuery \u5728\u53d8\u5316\u65f6\u89e6\u53d1\u91cd\u5efa\u3002<\/p>\n<\/li>\n<li>\n<p>\u4fee\u590d\u6309\u573a\u666f\u5206\u5c42&#xff1a;\u53c2\u4e0e Flex \u7684\u5c3a\u5bf8\u7528 Expanded\/Flexible&#xff1b;\u6587\u672c\u5bb9\u5668\u7528 ConstrainedBox(minHeight:) \u800c\u975e\u56fa\u5b9a\u9ad8\u5ea6&#xff1b;\u5c40\u90e8\u5c3a\u5bf8\u51b3\u7b56\u7528 LayoutBuilder&#xff1b;\u5e03\u5c40\u7ed3\u6784\u53d8\u5316\u7528 LayoutBuilder &#043; \u65ad\u70b9&#xff1b;\u7269\u7406\u50cf\u7d20\u610f\u56fe\u7528 devicePixelRatio \u8f6c\u6362&#xff1b;TextScaler.clamp \u4ec5\u4f5c\u4e3a\u6781\u7aef\u7ea6\u675f\u4e0b\u7684\u6700\u540e\u624b\u6bb5\u3002<\/p>\n<\/li>\n<li>\n<p>\u9884\u9632\u7684\u6838\u5fc3\u662f\u8ba9\u5c3a\u5bf8\u51b3\u7b56\u6709\u53c2\u7167\u7cfb&#xff1a;\u9ed8\u8ba4\u4f7f\u7528\u5f39\u6027\u7ea6\u675f&#xff0c;\u56fa\u5b9a\u5c3a\u5bf8\u9700\u8981\u53ef\u9648\u8ff0\u7684\u8bed\u4e49\u7406\u7531&#xff1b;\u5305\u542b\u6587\u672c\u7684\u5bb9\u5668\u9ed8\u8ba4\u4e0d\u4f7f\u7528\u56fa\u5b9a\u9ad8\u5ea6&#xff1b;\u5728 CI \u4e2d\u8986\u76d6\u5c0f\u5c4f\u3001\u5927\u5c4f\u3001\u6a2a\u5c4f\u3001TextScaler 1.5\/2.0 \u548c\u5206\u6570 DPR \u7684\u6d4b\u8bd5\u77e9\u9635\u3002\u4e0d\u662f\u6240\u6709\u56fa\u5b9a\u5c3a\u5bf8\u90fd\u662f\u9519\u7684\u2014\u2014\u6709\u8bed\u4e49\u7684\u56fa\u5b9a\u5c3a\u5bf8\u5e94\u8be5\u88ab\u4fdd\u7559\u5e76\u547d\u540d\u4e3a\u5e38\u91cf&#xff0c;\u65e0\u8bed\u4e49\u7684\u6570\u503c\u786c\u7f16\u7801\u624d\u662f\u4fee\u590d\u7684\u76ee\u6807\u3002<\/p>\n<\/li>\n<h3>\u4e5d\u3001\u4e0b\u8282\u8bfe\u9884\u544a<\/h3>\n<p>\u7b2c10\u8bfe&#xff1a;Stack \u5c42\u7ea7\u906e\u6321\u5751&#xff5c;\u7ec4\u4ef6\u53e0\u653e\u5bfc\u81f4\u70b9\u51fb\u5931\u6548&#xff0c;\u6392\u67e5\u4fee\u590d<\/p>\n<p>\u4e0b\u4e00\u8bfe\u5c06\u4ece\u201c\u5c3a\u5bf8\u7684\u6570\u503c\u201d\u56de\u5230\u201c\u5c42\u53e0\u7684\u987a\u5e8f\u201d&#xff1a;Stack \u8ba9\u591a\u4e2a Widget \u53ef\u4ee5\u53e0\u653e\u5728\u4e00\u8d77&#xff0c;\u4f46\u8c01\u5728\u4e0a\u3001\u8c01\u5728\u4e0b\u3001\u8c01\u7684\u70b9\u51fb\u4e8b\u4ef6\u80fd\u5230\u8fbe\u3001\u8c01\u88ab\u8c01\u7684\u5b50\u7ea7\u6ea2\u51fa\u906e\u6321\u2014\u2014\u8fd9\u4e9b\u95ee\u9898\u7684\u7b54\u6848\u4e0d\u662f\u7531\u4ee3\u7801\u7684\u4e66\u5199\u987a\u5e8f\u5355\u72ec\u51b3\u5b9a\u7684&#xff0c;\u800c\u662f\u7531\u5b50\u7ea7\u7684\u6392\u5217\u3001Positioned \u7684\u5b9a\u4f4d\u3001clipBehavior \u7684\u88c1\u526a\u8303\u56f4\u3001\u4ee5\u53ca HitTestBehavior \u7684\u547d\u4e2d\u6d4b\u8bd5\u7b56\u7565\u5171\u540c\u534f\u5546\u7684\u3002\u4f60\u5c06\u770b\u5230&#xff1a;\u4e3a\u4ec0\u4e48\u4e00\u4e2a\u89c6\u89c9\u4e0a\u53ef\u89c1\u7684\u6309\u94ae\u70b9\u51fb\u65e0\u6548\u3001Positioned \u8d85\u51fa Stack \u8fb9\u754c\u65f6\u70b9\u51fb\u533a\u57df\u5982\u4f55\u53d8\u5316\u3001IgnorePointer \u548c AbsorbPointer \u5728\u4ec0\u4e48\u573a\u666f\u4e0b\u662f\u201c\u906e\u853d\u201d\u800c\u4e0d\u662f\u201c\u7981\u7528\u201d\u3001\u4ee5\u53ca\u5982\u4f55\u7528 Stack \u7684 alignment \u548c fit \u53c2\u6570\u628a\u201c\u5c42\u7ea7\u201d\u4ece\u8bd5\u9519\u53d8\u6210\u53ef\u63a8\u7406\u7684\u7ed3\u6784\u3002\u5c3a\u5bf8\u786c\u7f16\u7801\u662f\u201c\u7528\u56fa\u5b9a\u6570\u503c\u66ff\u4ee3\u7ea6\u675f\u534f\u5546\u201d&#xff0c;Stack \u906e\u6321\u662f\u201c\u7528\u89c6\u89c9\u5c42\u7ea7\u66ff\u4ee3\u547d\u4e2d\u6d4b\u8bd5\u5c42\u7ea7\u201d\u2014\u2014\u4e24\u8005\u90fd\u4f9d\u8d56\u540c\u4e00\u4e2a\u8ba4\u77e5&#xff1a;\u5728 Flutter \u4e2d&#xff0c;\u4f60\u770b\u5230\u7684\u4e0d\u7b49\u4e8e\u4f60\u70b9\u5230\u7684&#xff0c;\u4f60\u5199\u5230\u7684\u4e0d\u7b49\u4e8e\u8fd0\u884c\u65f6\u751f\u6548\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6458\u8981 \u672c\u6587\u805a\u7126 Flutter \u5e03\u5c40\u4e2d\u300c\u5c3a\u5bf8\u786c\u7f16\u7801\u300d\u8fd9\u4e00\u9ad8\u9891\u5374\u9690\u853d\u7684\u6545\u969c\u6e90\u3002\u4ece\u4e09\u79cd\u5178\u578b\u300c\u9519\u4e71\u59ff\u6001\u300d\u5207\u5165\u2014\u2014\u4f2a\u52a8\u6001\u8ba1\u7b97\u3001\u56fa\u5b9a\u9ad8\u5ea6\u53e0\u52a0\u6587\u672c\u7f29\u653e\u3001\u903b\u8f91\u50cf\u7d20\u4e0e\u7269\u7406\u50cf\u7d20\u6df7\u6dc6\u2014\u2014\u63ed\u793a\u5176\u5171\u540c\u6839\u56e0&#xff1a;\u7528\u300c\u6570\u503c\u786e\u5b9a\u6027\u300d\u66ff\u4ee3\u4e86\u300c\u7ea6\u675f\u534f\u5546\u300d\u3002\u968f\u540e\u5f52\u7eb3\u56db\u79cd\u7ecf\u5178\u6545\u969c\u6a21\u5f0f&#xff0c;\u7ed9\u51fa\u4e94\u6b65\u7cfb\u7edf\u6027\u6392\u67e5\u65b9\u6cd5\u8bba&#xff0c;\u5e76\u6309\u573a\u666f\u5206\u4e94\u5c42\u9012\u8fdb\u4fee\u590d&#xff1a;\u5f39\u6027\u7ea6\u675f\u3001LayoutBuilder \u5c40\u90e8\u51b3\u7b56\u3001\u5185\u5bb9\u9a71\u52a8\u9ad8\u5ea6\u3001devicePixelRatio \u5904\u7406\u7269\u7406\u50cf\u7d20\u610f\u56fe\u3001\u65ad\u70b9\u5206\u652f\u5904\u7406\u7ed3\u6784<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6323,84,2878,1680,4052],"topic":[],"class_list":["post-120208","post","type-post","status-publish","format-standard","hentry","category-server","tag-dart","tag-android","tag-flutter","tag-ios","tag-4052"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/120208.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6458\u8981 \u672c\u6587\u805a\u7126 Flutter \u5e03\u5c40\u4e2d\u300c\u5c3a\u5bf8\u786c\u7f16\u7801\u300d\u8fd9\u4e00\u9ad8\u9891\u5374\u9690\u853d\u7684\u6545\u969c\u6e90\u3002\u4ece\u4e09\u79cd\u5178\u578b\u300c\u9519\u4e71\u59ff\u6001\u300d\u5207\u5165\u2014\u2014\u4f2a\u52a8\u6001\u8ba1\u7b97\u3001\u56fa\u5b9a\u9ad8\u5ea6\u53e0\u52a0\u6587\u672c\u7f29\u653e\u3001\u903b\u8f91\u50cf\u7d20\u4e0e\u7269\u7406\u50cf\u7d20\u6df7\u6dc6\u2014\u2014\u63ed\u793a\u5176\u5171\u540c\u6839\u56e0&#xff1a;\u7528\u300c\u6570\u503c\u786e\u5b9a\u6027\u300d\u66ff\u4ee3\u4e86\u300c\u7ea6\u675f\u534f\u5546\u300d\u3002\u968f\u540e\u5f52\u7eb3\u56db\u79cd\u7ecf\u5178\u6545\u969c\u6a21\u5f0f&#xff0c;\u7ed9\u51fa\u4e94\u6b65\u7cfb\u7edf\u6027\u6392\u67e5\u65b9\u6cd5\u8bba&#xff0c;\u5e76\u6309\u573a\u666f\u5206\u4e94\u5c42\u9012\u8fdb\u4fee\u590d&#xff1a;\u5f39\u6027\u7ea6\u675f\u3001LayoutBuilder \u5c40\u90e8\u51b3\u7b56\u3001\u5185\u5bb9\u9a71\u52a8\u9ad8\u5ea6\u3001devicePixelRatio \u5904\u7406\u7269\u7406\u50cf\u7d20\u610f\u56fe\u3001\u65ad\u70b9\u5206\u652f\u5904\u7406\u7ed3\u6784\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/120208.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-30T23:25:07+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"24 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/120208.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/120208.html\",\"name\":\"\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-30T23:25:07+00:00\",\"dateModified\":\"2026-10-30T23:25:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/120208.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/120208.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/120208.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/120208.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6458\u8981 \u672c\u6587\u805a\u7126 Flutter \u5e03\u5c40\u4e2d\u300c\u5c3a\u5bf8\u786c\u7f16\u7801\u300d\u8fd9\u4e00\u9ad8\u9891\u5374\u9690\u853d\u7684\u6545\u969c\u6e90\u3002\u4ece\u4e09\u79cd\u5178\u578b\u300c\u9519\u4e71\u59ff\u6001\u300d\u5207\u5165\u2014\u2014\u4f2a\u52a8\u6001\u8ba1\u7b97\u3001\u56fa\u5b9a\u9ad8\u5ea6\u53e0\u52a0\u6587\u672c\u7f29\u653e\u3001\u903b\u8f91\u50cf\u7d20\u4e0e\u7269\u7406\u50cf\u7d20\u6df7\u6dc6\u2014\u2014\u63ed\u793a\u5176\u5171\u540c\u6839\u56e0&#xff1a;\u7528\u300c\u6570\u503c\u786e\u5b9a\u6027\u300d\u66ff\u4ee3\u4e86\u300c\u7ea6\u675f\u534f\u5546\u300d\u3002\u968f\u540e\u5f52\u7eb3\u56db\u79cd\u7ecf\u5178\u6545\u969c\u6a21\u5f0f&#xff0c;\u7ed9\u51fa\u4e94\u6b65\u7cfb\u7edf\u6027\u6392\u67e5\u65b9\u6cd5\u8bba&#xff0c;\u5e76\u6309\u573a\u666f\u5206\u4e94\u5c42\u9012\u8fdb\u4fee\u590d&#xff1a;\u5f39\u6027\u7ea6\u675f\u3001LayoutBuilder \u5c40\u90e8\u51b3\u7b56\u3001\u5185\u5bb9\u9a71\u52a8\u9ad8\u5ea6\u3001devicePixelRatio \u5904\u7406\u7269\u7406\u50cf\u7d20\u610f\u56fe\u3001\u65ad\u70b9\u5206\u652f\u5904\u7406\u7ed3\u6784","og_url":"https:\/\/www.wsisp.com\/helps\/120208.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-30T23:25:07+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"24 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/120208.html","url":"https:\/\/www.wsisp.com\/helps\/120208.html","name":"\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-30T23:25:07+00:00","dateModified":"2026-10-30T23:25:07+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/120208.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/120208.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/120208.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Flutter\u8e29\u5751\u6392\u96f7\u3011\u7b2c9\u8bfe\uff1a\u5c3a\u5bf8\u786c\u7f16\u7801\u5751\uff5c\u56fa\u5b9a\u5c3a\u5bf8\uff0c\u591a\u8bbe\u5907\u9002\u914d\u9519\u4e71\u4fee\u590d"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/120208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=120208"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/120208\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=120208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=120208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=120208"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=120208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}