forked from CarGuo/gsy_github_app_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGSYCardItem.dart
More file actions
29 lines (25 loc) · 950 Bytes
/
GSYCardItem.dart
File metadata and controls
29 lines (25 loc) · 950 Bytes
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
import 'package:flutter/material.dart';
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
/**
* Card Widget
* Created by guoshuyu
* Date: 2018-07-16
*/
class GSYCardItem extends StatelessWidget {
final Widget child;
final EdgeInsets margin;
final Color color;
final RoundedRectangleBorder shape;
final double elevation;
GSYCardItem({@required this.child, this.margin, this.color, this.shape, this.elevation = 5.0});
@override
Widget build(BuildContext context) {
EdgeInsets margin = this.margin;
RoundedRectangleBorder shape = this.shape;
Color color = this.color;
margin ??= EdgeInsets.only(left: 10.0, top: 10.0, right: 10.0, bottom: 10.0);
shape ??= new RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)));
color ??= new Color(GSYColors.cardWhite);
return new Card(elevation: elevation, shape: shape, color: color, margin: margin, child: child);
}
}