{"id":805,"date":"2023-08-03T21:17:19","date_gmt":"2023-08-03T13:17:19","guid":{"rendered":"http:\/\/gjweb.top\/?p=805"},"modified":"2023-08-03T21:17:21","modified_gmt":"2023-08-03T13:17:21","slug":"flutter-%e6%b6%88%e6%81%af%e5%b0%8f%e7%ba%a2%e7%82%b9%e6%8f%90%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=805","title":{"rendered":"flutter \u6d88\u606f\u5c0f\u7ea2\u70b9\u63d0\u793a"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"\u5b89\u88c5\">\u5b89\u88c5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>badges: ^3.1.1<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u5f15\u7528\">\u5f15\u7528<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:badges\/badges.dart' as badges;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u57fa\u7840\u4f7f\u7528\">\u57fa\u7840\u4f7f\u7528<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>badges.Badge(<br> &nbsp; &nbsp;badgeContent: Text('3'), \/*\u7ea2\u70b9\u4e2d\u7684\u6587\u672c*\/<br> &nbsp; &nbsp;child: Icon(Icons.settings), \/*\u5d4c\u5957\u7684 widget*\/<br>)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u9ad8\u7ea7\u914d\u7f6e\">\u9ad8\u7ea7\u914d\u7f6e<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>badges.Badge(<br> &nbsp; &nbsp; &nbsp;position: badges.BadgePosition.topEnd(top: -10, end: -12), \/*\u5b9a\u4f4d\u7684\u4f4d\u7f6e*\/<br> &nbsp; &nbsp; &nbsp;showBadge: true, \/*\u662f\u5426\u663e\u793a\u5c0f\u7ea2\u70b9*\/<br> &nbsp; &nbsp; &nbsp;ignorePointer: false, \/*\u662f\u5426\u5ffd\u7565\u7ea2\u70b9\u7684\u70b9\u51fb\u4e8b\u4ef6*\/<br> &nbsp; &nbsp; &nbsp;onTap: () {},\/*\u70b9\u51fb\u4e8b\u4ef6*\/<br> &nbsp; &nbsp; &nbsp;badgeContent:Icon(Icons.check, color: Colors.white, size: 10), \/*\u7ea2\u70b9\u7684\u5185\u5bb9*\/<br> &nbsp; &nbsp; &nbsp;badgeAnimation: badges.BadgeAnimation.rotation( \/*\u52a8\u753b\u6548\u679c*\/<br> &nbsp; &nbsp; &nbsp; &nbsp;animationDuration: Duration(seconds: 1),<br> &nbsp; &nbsp; &nbsp; &nbsp;colorChangeAnimationDuration: Duration(seconds: 1),<br> &nbsp; &nbsp; &nbsp; &nbsp;loopAnimation: false,<br> &nbsp; &nbsp; &nbsp; &nbsp;curve: Curves.fastOutSlowIn,<br> &nbsp; &nbsp; &nbsp; &nbsp;colorChangeAnimationCurve: Curves.easeInCubic,<br> &nbsp; &nbsp;  ),<br> &nbsp; &nbsp; &nbsp;badgeStyle: badges.BadgeStyle( \/*\u7ea2\u70b9\u7684\u6837\u5f0f*\/<br> &nbsp; &nbsp; &nbsp; &nbsp;shape: badges.BadgeShape.square,<br> &nbsp; &nbsp; &nbsp; &nbsp;badgeColor: Colors.blue,<br> &nbsp; &nbsp; &nbsp; &nbsp;padding: EdgeInsets.all(5),<br> &nbsp; &nbsp; &nbsp; &nbsp;borderRadius: BorderRadius.circular(4),<br> &nbsp; &nbsp; &nbsp; &nbsp;borderSide: BorderSide(color: Colors.white, width: 2),<br> &nbsp; &nbsp; &nbsp; &nbsp;borderGradient: badges.BadgeGradient.linear(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;colors: &#91;Colors.red, Colors.black]),<br> &nbsp; &nbsp; &nbsp; &nbsp;badgeGradient: badges.BadgeGradient.linear(<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;colors: &#91;Colors.blue, Colors.yellow],<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin: Alignment.topCenter,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end: Alignment.bottomCenter,<br> &nbsp; &nbsp; &nbsp;  ),<br> &nbsp; &nbsp; &nbsp; &nbsp;elevation: 0,<br> &nbsp; &nbsp;  ),<br> &nbsp; &nbsp; &nbsp;child: Text('Badge'), \/*\u5b50\u7ec4\u4ef6 *\/<br> &nbsp;  ),<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5 \u5f15\u7528 \u57fa\u7840\u4f7f\u7528 \u9ad8\u7ea7\u914d\u7f6e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63],"tags":[],"class_list":["post-805","post","type-post","status-publish","format-standard","hentry","category-flutter"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/805","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=805"}],"version-history":[{"count":1,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/805\/revisions"}],"predecessor-version":[{"id":806,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/805\/revisions\/806"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}