Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created May 28, 2019 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcinusX/3f48dad095a1c38855ca2225333d0376 to your computer and use it in GitHub Desktop.
Save MarcinusX/3f48dad095a1c38855ca2225333d0376 to your computer and use it in GitHub Desktop.
class ExpandedEventItem extends StatelessWidget {
final double topMargin;
final double leftMargin;
final double height;
final bool isVisible;
final double borderRadius;
final String title;
final String date;
const ExpandedEventItem({
Key key,
this.topMargin,
this.height,
this.isVisible,
this.borderRadius,
this.title,
this.date,
this.leftMargin,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Positioned(
top: topMargin,
left: leftMargin,
right: 0,
height: height,
child: AnimatedOpacity(
opacity: isVisible ? 1 : 0,
duration: Duration(milliseconds: 200),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius),
color: Colors.white,
),
padding: EdgeInsets.only(left: height).add(EdgeInsets.all(8)),
child: _buildContent(),
),
),
);
}
Widget _buildContent() {
return Column(
children: <Widget>[
Text(title, style: TextStyle(fontSize: 16)),
SizedBox(height: 8),
Row(
children: <Widget>[
Text(
'1 ticket',
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 12,
color: Colors.grey.shade600,
),
),
SizedBox(width: 8),
Text(
date,
style: TextStyle(
fontWeight: FontWeight.w300,
fontSize: 12,
color: Colors.grey,
),
),
],
),
Spacer(),
Row(
children: <Widget>[
Icon(
Icons.place,
color: Colors.grey.shade400,
size: 16,
),
Text(
'Science Park 10 25A',
style: TextStyle(
color: Colors.grey.shade400,
fontSize: 13,
),
)
],
)
],
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment