Skip to content

Commit

Permalink
refactor:按规范修改代码、注释等
Browse files Browse the repository at this point in the history
  • Loading branch information
Nealyang committed Feb 19, 2019
1 parent c2da46a commit 9270581
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 38 deletions.
27 changes: 7 additions & 20 deletions lib/components/list_refresh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ class _ListRefreshState extends State<ListRefresh> {
});
}

/*
* 回弹效果
* */
// 回弹效果
backElasticEffect() {
// double edge = 50.0;
// double offsetFromBottom = _scrollController.position.maxScrollExtent - _scrollController.position.pixels;
Expand All @@ -55,9 +53,7 @@ class _ListRefreshState extends State<ListRefresh> {
// }
}

/*
* list探底,执行的具体事件
* */
// list探底,执行的具体事件
Future _getMoreData() async {
if (!isLoading && _hasMore) {
// 如果上一次异步请求数据完成 同时有数据可以加载
Expand All @@ -82,9 +78,7 @@ class _ListRefreshState extends State<ListRefresh> {
}
}

/*
* 伪装吐出新数据
* */
// 伪装吐出新数据
Future<List> mokeHttpRequest() async {
if (widget.requestApi is Function) {
final listObj = await widget.requestApi({'pageIndex': _pageIndex});
Expand All @@ -97,11 +91,8 @@ class _ListRefreshState extends State<ListRefresh> {
});
}
}

/*
* 下拉加载的事件,清空之前list内容,取前X个
* 其实就是列表重置
* */
// 下拉加载的事件,清空之前list内容,取前X个
// 其实就是列表重置
Future<Null> _handleRefresh() async {
List newEntries = await mokeHttpRequest();
if (this.mounted) {
Expand All @@ -115,9 +106,7 @@ class _ListRefreshState extends State<ListRefresh> {
}
}

/*
* 加载中的提示
* */
// 加载中的提示
Widget _buildLoadText() {
return Container(
child: Padding(
Expand All @@ -128,9 +117,7 @@ class _ListRefreshState extends State<ListRefresh> {
));
}

/*
* 上提加载loading的widget,如果数据到达极限,显示没有更多
* */
// 上提加载loading的widget,如果数据到达极限,显示没有更多
Widget _buildProgressIndicator() {
if (_hasMore) {
return new Padding(
Expand Down
4 changes: 1 addition & 3 deletions lib/components/search_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,7 @@ class History extends StatefulWidget {
_History createState() => _History();
}

/*
* AppBar 默认的实例,有状态
* */
// AppBar 默认的实例,有状态
class _History extends State<History> {


Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/components/Card/Card/demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ class CardLessDefault extends StatelessWidget {
children: <Widget>[
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: () { },
),
],
),
Expand Down
18 changes: 9 additions & 9 deletions lib/widgets/components/Grid/GridTileBar/index.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Created with Android Studio.
* User: 三帆
* Date: 07/01/2019
* Time: 10:26
* email: [email protected]
* target: xxx
*/
import 'package:flutter_go/components/widget_demo.dart';
/// Created with Android Studio.
/// User: 三帆
/// Date: 07/01/2019
/// Time: 10:26
/// email: [email protected]
/// target: xxx
import 'package:flutter/material.dart';

import 'package:flutter_go/components/widget_demo.dart';
import 'demo.dart';

const String _Text0 = """
Expand Down
7 changes: 3 additions & 4 deletions lib/widgets/elements/Form/Button/DropdownButton/demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import 'package:flutter/material.dart';

/*
* DropdownButton 默认按钮的实例
* isDisabled:是否是禁用,isDisabled 默认为true
* */
// DropdownButton 默认按钮的实例
// isDisabled:是否是禁用,isDisabled 默认为true

var selectItValue;
var selectItemValue;

Expand Down

0 comments on commit 9270581

Please sign in to comment.