forked from CarGuo/gsy_github_app_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGSYSearchInputWidget.dart
More file actions
50 lines (45 loc) · 1.88 KB
/
GSYSearchInputWidget.dart
File metadata and controls
50 lines (45 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import 'package:flutter/material.dart';
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
import 'package:gsy_github_app_flutter/common/utils/CommonUtils.dart';
/**
* 搜索输入框
* Created by guoshuyu
* Date: 2018-07-20
*/
class GSYSearchInputWidget extends StatelessWidget {
final ValueChanged<String> onChanged;
final ValueChanged<String> onSubmitted;
final VoidCallback onSubmitPressed;
GSYSearchInputWidget(this.onChanged, this.onSubmitted, this.onSubmitPressed);
@override
Widget build(BuildContext context) {
return new Container(
decoration: new BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.0)),
color: Color(GSYColors.white),
border: new Border.all(color: Theme.of(context).primaryColor, width: 0.3),
boxShadow: [BoxShadow(color: Theme.of(context).primaryColorDark, blurRadius: 4.0)]),
padding: new EdgeInsets.only(left: 20.0, top: 12.0, right: 20.0, bottom: 12.0),
child: new Row(
children: <Widget>[
new Expanded(
child: new TextField(
autofocus: false,
decoration: new InputDecoration.collapsed(
hintText: CommonUtils.getLocale(context).repos_issue_search,
hintStyle: GSYConstant.middleSubText,
),
style: GSYConstant.middleText,
onChanged: onChanged,
onSubmitted: onSubmitted)),
new RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: const EdgeInsets.only(right: 5.0, left: 10.0),
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
child: new Icon(GSYICons.SEARCH, size: 15.0, color: Theme.of(context).primaryColorDark,),
onPressed: onSubmitPressed)
],
),
);
}
}