{"id":634,"date":"2023-03-05T11:03:06","date_gmt":"2023-03-05T03:03:06","guid":{"rendered":"http:\/\/gjweb.top\/?p=634"},"modified":"2023-05-17T19:04:59","modified_gmt":"2023-05-17T11:04:59","slug":"07-get_cli%e8%84%9a%e6%89%8b%e6%9e%b6%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=634","title":{"rendered":"07. Get_cli\u811a\u624b\u67b6\u4f7f\u7528"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"\u5b89\u88c5\">\u5b89\u88c5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>flutter pub global activate get_cli<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u64cd\u4f5c\">\u64cd\u4f5c<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u521d\u59cb\u5316\u9879\u76ee\">\u521d\u59cb\u5316\u9879\u76ee<\/h3>\n\n\n\n<p>\u521b\u5efa flutter \u9879\u76ee\u540e\u6267\u884c\u4e0b\u9762\u547d\u4ee4,\u4f1a\u91cd\u6784 lib \u6587\u4ef6,\u751f\u6210 get\u6587\u4ef6\u6a21\u677f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>get init<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u521b\u5efa\u9875\u9762\">\u521b\u5efa\u9875\u9762<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>get create page:xxx<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u521b\u5efa-getcontroller\">\u521b\u5efa GetController<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>get  create controller:xxx<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u521b\u5efa-view-\u751f\u6210\u4e00\u4e2a-getview-\u7684\u6587\u4ef6\">\u521b\u5efa View,\u751f\u6210\u4e00\u4e2a GetView \u7684\u6587\u4ef6<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>get create view:xxx<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"\u751f\u6210\u56fd\u9645\u5316\u6587\u4ef6\">\u751f\u6210\u56fd\u9645\u5316\u6587\u4ef6<\/h3>\n\n\n\n<p>\u5728\u6839\u76ee\u5f55\u4e2d\u521b\u5efa assets \/ locales \u6587\u4ef6 xxx.json \u683c\u5f0f<\/p>\n\n\n\n<p>zh_CN.json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br> &nbsp; &nbsp;\"buttons\": {<br> &nbsp; &nbsp; &nbsp; &nbsp;\"login\": \"\u767b\u5f55\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"sign_in\": \"\u6ce8\u518c\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"logout\": \"\u6ce8\u9500\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"sign_in_fb\": \"\u7528 Facebook \u767b\u5f55\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"sign_in_google\": \"\u7528 Google \u767b\u5f55\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"sign_in_apple\": \"\u7528 Apple \u767b\u5f55\"<br> &nbsp;  }<br>}<\/code><\/pre>\n\n\n\n<p>en_US.json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br> &nbsp; &nbsp;\"buttons\": {<br> &nbsp; &nbsp; &nbsp; &nbsp;\"login\": \"Login\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"sign_in\": \"Sign-in\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"logout\": \"Logout\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"sign_in_fb\": \"Sign-in with Facebook\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"sign_in_google\": \"Sign-in with Google\",<br> &nbsp; &nbsp; &nbsp; &nbsp;\"sign_in_apple\": \"Sign-in with Apple\"<br> &nbsp;  }<br>}<\/code><\/pre>\n\n\n\n<p>\u8fd0\u884c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>get generate locales assets\/locales<\/code><\/pre>\n\n\n\n<p>\u5728 GetMaterialApp \u4e2d\u52a0\u5165<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import \"AppTranslation.dart\"<br>GetMaterialApp(<br>    ...<br>    translationsKeys: AppTranslation.translations,<br>    locale:const Locale('zh', 'CN'), \/\/ \u5c06\u4f1a\u6309\u7167\u6b64\u5904\u6307\u5b9a\u7684\u8bed\u8a00\u7ffb\u8bd1<br>    fallbackLocale:const Locale('en', 'US'), \/\/ \u6dfb\u52a0\u4e00\u4e2a\u56de\u8c03\u8bed\u8a00\u9009\u9879\uff0c\u4ee5\u5907\u4e0a\u9762\u6307\u5b9a\u7684\u8bed\u8a00\u7ffb\u8bd1\u4e0d\u5b58\u5728<br>    ...<br>)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5 \u64cd\u4f5c \u521d\u59cb\u5316\u9879\u76ee \u521b\u5efa flutter \u9879\u76ee\u540e\u6267\u884c\u4e0b\u9762\u547d\u4ee4,\u4f1a\u91cd\u6784 lib \u6587\u4ef6,\u751f\u6210 get\u6587\u4ef6\u6a21\u677f  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[],"class_list":["post-634","post","type-post","status-publish","format-standard","hentry","category-getx"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=634"}],"version-history":[{"count":2,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/634\/revisions"}],"predecessor-version":[{"id":715,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/634\/revisions\/715"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}