Skip to content

Commit 169532c

Browse files
committed
search widget
1 parent 0471d05 commit 169532c

2 files changed

Lines changed: 32 additions & 12 deletions

File tree

‎lib/page/RepositoryDetailIssueList.dart‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:gsy_github_app_flutter/common/dao/IssueDao.dart';
33
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
44
import 'package:gsy_github_app_flutter/widget/GSYListState.dart';
55
import 'package:gsy_github_app_flutter/widget/GSYPullLoadWidget.dart';
6+
import 'package:gsy_github_app_flutter/widget/GSYSearchInputWidget.dart';
67
import 'package:gsy_github_app_flutter/widget/IssueItem.dart';
78
import 'package:gsy_github_app_flutter/widget/GSYSelectItemWidget.dart';
89

@@ -82,18 +83,7 @@ class _RepositoryDetailIssuePageState extends GSYListState<RepositoryDetailIssue
8283
backgroundColor: Color(GSYColors.mainBackgroundColor),
8384
appBar: new AppBar(
8485
leading: new Container(),
85-
flexibleSpace: new Container(
86-
padding: new EdgeInsets.only(left: 20.0, top: 12.0, right: 20.0, bottom: 12.0),
87-
color: Colors.white,
88-
child: new TextField(
89-
autofocus: false,
90-
decoration: new InputDecoration.collapsed(
91-
hintText: GSYStrings.repos_issue_search,
92-
hintStyle: GSYConstant.subSmallText,
93-
),
94-
style: GSYConstant.smallText,
95-
onSubmitted: (result) {}),
96-
),
86+
flexibleSpace: GSYSearchInputWidget((value){}),
9787
elevation: 0.0,
9888
backgroundColor: Color(GSYColors.mainBackgroundColor),
9989
bottom: new GSYSelectItemWidget([
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
3+
4+
/**
5+
* 搜索输入框
6+
* Created by guoshuyu
7+
* Date: 2018-07-20
8+
*/
9+
class GSYSearchInputWidget extends StatelessWidget {
10+
final ValueChanged<String> onSubmitted;
11+
12+
GSYSearchInputWidget(this.onSubmitted);
13+
14+
@override
15+
Widget build(BuildContext context) {
16+
return new Container(
17+
decoration: new BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(4.0)),
18+
color: Colors.white, border: new Border.all(color: Color(GSYColors.subTextColor), width: 0.3)),
19+
padding: new EdgeInsets.only(left: 20.0, top: 12.0, right: 20.0, bottom: 12.0),
20+
child: new TextField(
21+
autofocus: false,
22+
decoration: new InputDecoration.collapsed(
23+
hintText: GSYStrings.repos_issue_search,
24+
hintStyle: GSYConstant.middleSubText,
25+
),
26+
style: GSYConstant.middleText,
27+
onSubmitted: onSubmitted),
28+
);
29+
}
30+
}

0 commit comments

Comments
 (0)