From 9270581af6116749e2bc890b9a49adf9260eddd2 Mon Sep 17 00:00:00 2001 From: "yifeng.yl" Date: Tue, 19 Feb 2019 11:56:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E6=8C=89=E8=A7=84=E8=8C=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BB=A3=E7=A0=81=E3=80=81=E6=B3=A8=E9=87=8A=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/list_refresh.dart | 27 +++++-------------- lib/components/search_input.dart | 4 +-- lib/widgets/components/Card/Card/demo.dart | 4 +-- .../components/Grid/GridTileBar/index.dart | 18 ++++++------- .../Form/Button/DropdownButton/demo.dart | 7 +++-- 5 files changed, 22 insertions(+), 38 deletions(-) diff --git a/lib/components/list_refresh.dart b/lib/components/list_refresh.dart index e6652e35..b4a13244 100644 --- a/lib/components/list_refresh.dart +++ b/lib/components/list_refresh.dart @@ -41,9 +41,7 @@ class _ListRefreshState extends State { }); } - /* - * 回弹效果 - * */ +// 回弹效果 backElasticEffect() { // double edge = 50.0; // double offsetFromBottom = _scrollController.position.maxScrollExtent - _scrollController.position.pixels; @@ -55,9 +53,7 @@ class _ListRefreshState extends State { // } } - /* - * list探底,执行的具体事件 - * */ +// list探底,执行的具体事件 Future _getMoreData() async { if (!isLoading && _hasMore) { // 如果上一次异步请求数据完成 同时有数据可以加载 @@ -82,9 +78,7 @@ class _ListRefreshState extends State { } } - /* - * 伪装吐出新数据 - * */ +// 伪装吐出新数据 Future mokeHttpRequest() async { if (widget.requestApi is Function) { final listObj = await widget.requestApi({'pageIndex': _pageIndex}); @@ -97,11 +91,8 @@ class _ListRefreshState extends State { }); } } - - /* - * 下拉加载的事件,清空之前list内容,取前X个 - * 其实就是列表重置 - * */ +// 下拉加载的事件,清空之前list内容,取前X个 +// 其实就是列表重置 Future _handleRefresh() async { List newEntries = await mokeHttpRequest(); if (this.mounted) { @@ -115,9 +106,7 @@ class _ListRefreshState extends State { } } - /* - * 加载中的提示 - * */ +// 加载中的提示 Widget _buildLoadText() { return Container( child: Padding( @@ -128,9 +117,7 @@ class _ListRefreshState extends State { )); } - /* - * 上提加载loading的widget,如果数据到达极限,显示没有更多 - * */ +// 上提加载loading的widget,如果数据到达极限,显示没有更多 Widget _buildProgressIndicator() { if (_hasMore) { return new Padding( diff --git a/lib/components/search_input.dart b/lib/components/search_input.dart index 7305c6e7..90423b9e 100644 --- a/lib/components/search_input.dart +++ b/lib/components/search_input.dart @@ -409,9 +409,7 @@ class History extends StatefulWidget { _History createState() => _History(); } -/* -* AppBar 默认的实例,有状态 -* */ +// AppBar 默认的实例,有状态 class _History extends State { diff --git a/lib/widgets/components/Card/Card/demo.dart b/lib/widgets/components/Card/Card/demo.dart index 98e33e33..3a1d4269 100644 --- a/lib/widgets/components/Card/Card/demo.dart +++ b/lib/widgets/components/Card/Card/demo.dart @@ -62,11 +62,11 @@ class CardLessDefault extends StatelessWidget { children: [ FlatButton( child: const Text('BUY TICKETS',style: TextStyle(color: Colors.black, fontSize: 14.0)), - onPressed: () { /* ... */ }, + onPressed: () { }, ), FlatButton( child: const Text('LISTEN',style: TextStyle(color: Colors.black, fontSize: 14.0)), - onPressed: () { /* ... */ }, + onPressed: () { }, ), ], ), diff --git a/lib/widgets/components/Grid/GridTileBar/index.dart b/lib/widgets/components/Grid/GridTileBar/index.dart index 765f8c07..3579656b 100644 --- a/lib/widgets/components/Grid/GridTileBar/index.dart +++ b/lib/widgets/components/Grid/GridTileBar/index.dart @@ -1,13 +1,13 @@ -/** - * Created with Android Studio. - * User: 三帆 - * Date: 07/01/2019 - * Time: 10:26 - * email: sanfan.hx@alibaba-inc.com - * target: xxx - */ -import 'package:flutter_go/components/widget_demo.dart'; +/// Created with Android Studio. +/// User: 三帆 +/// Date: 07/01/2019 +/// Time: 10:26 +/// email: sanfan.hx@alibaba-inc.com +/// target: xxx + import 'package:flutter/material.dart'; + +import 'package:flutter_go/components/widget_demo.dart'; import 'demo.dart'; const String _Text0 = """ diff --git a/lib/widgets/elements/Form/Button/DropdownButton/demo.dart b/lib/widgets/elements/Form/Button/DropdownButton/demo.dart index fd861712..37768f0f 100644 --- a/lib/widgets/elements/Form/Button/DropdownButton/demo.dart +++ b/lib/widgets/elements/Form/Button/DropdownButton/demo.dart @@ -7,10 +7,9 @@ import 'package:flutter/material.dart'; -/* -* DropdownButton 默认按钮的实例 -* isDisabled:是否是禁用,isDisabled 默认为true -* */ +// DropdownButton 默认按钮的实例 +// isDisabled:是否是禁用,isDisabled 默认为true + var selectItValue; var selectItemValue;