forked from CarGuo/gsy_github_app_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGSYTitleBar.dart
More file actions
49 lines (42 loc) · 1.03 KB
/
GSYTitleBar.dart
File metadata and controls
49 lines (42 loc) · 1.03 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
import 'package:flutter/material.dart';
/**
* title 控件
* Created by guoshuyu
* on 2018/7/24.
*/
class GSYTitleBar extends StatelessWidget {
final String title;
final IconData iconData;
final VoidCallback onPressed;
final bool needRightLocalIcon;
final Widget rightWidget;
GSYTitleBar(this.title, {this.iconData, this.onPressed, this.needRightLocalIcon = false, this.rightWidget});
@override
Widget build(BuildContext context) {
Widget widget = rightWidget;
if (rightWidget == null) {
widget = (needRightLocalIcon)
? new IconButton(
icon: new Icon(
iconData,
size: 19.0,
),
onPressed: onPressed)
: new Container();
}
return Container(
child: new Row(
children: <Widget>[
new Expanded(
child: new Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
widget
],
),
);
}
}