Commit b756ccba authored by wonko's avatar wonko

card design umgebaut

parent 9f209216
......@@ -247,7 +247,7 @@ class Lecture {
.replaceAll(new RegExp(r"\s+\b|\b\s|\s|\b"), "");
}
Lecture l = Lecture(json['fs'], json['name'], json['teaser'],
Lecture l = Lecture(json['fs'].trim(), json['name'].trim(), json['teaser'].trim(),
json['aufz'], time, json['room'], start, end, json['id']);
return l;
......
......@@ -185,6 +185,12 @@ class _LectureCardState extends State<LectureCard> {
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final TextStyle titleStyle = theme.textTheme.subtitle;
final TextStyle descriptionStyle = theme.textTheme.caption;
final TextStyle nameStyle =
theme.textTheme.subtitle.copyWith(color: descriptionStyle.color);
print("Building Lecturecard $l");
if (!l.isEmpy()) {
IconData ico = Fachschaften().getIcon(l.fs);
......@@ -194,55 +200,115 @@ class _LectureCardState extends State<LectureCard> {
padding: EdgeInsets.only(
left: 50.0, top: 0.0, right: 10.0, bottom: 0.0),
child: Card(
color: Fachschaften().getColor(l.fs),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
color: Fachschaften().getColor(l.fs),
child: Padding(
padding: const EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: DefaultTextStyle(
softWrap: true,
//overflow: TextOverflow.ellipsis,
style: descriptionStyle,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Row(
children: <Widget>[
Text(
l.fs,
style: descriptionStyle,
),
Expanded(
child: Align(
alignment: Alignment.centerRight,
child: Text(
"${l.room}: ${l.time}",
style: descriptionStyle,
)))
],
),
),
Row(children: <Widget>[
Icon(
ico,
size: 50.0,
color: Colors.black,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.only(left: 10.0),
child: Column(children: <Widget>[
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.only(
bottom: 4.0),
child: Text(
l.name,
style: nameStyle,
),
)),
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.only(
bottom: 4.0),
child: Text(
l.teaser,
style: titleStyle,
),
))
]))),
]),
Spacer(),
ButtonTheme.bar(
//color:Colors.green,
// make buttons use the appropriate styles for cards
child: ButtonBar(
children: <Widget>[
IconButton(
icon: l.like
? Icon(Icons.favorite)
: Icon(Icons.favorite_border),
tooltip: 'blah',
onPressed: () {
setState(() {
l.like = !l.like;
});
}),
],
),
),
],
),
)))));
} else {
return Container(height: pxFromDureation(l.start, l.end));
}
}
}
/* Text(),
ListTile(
leading: Icon(
ico,
size: 50.0,
color: Colors.black,
),
title: Text(l.teaser),
subtitle: Text(l.name)),
Padding(
padding: const EdgeInsets.only(left: 80.0),
child: Column(children: <Widget>[
Align(
alignment: Alignment.centerLeft,
child: Text(l.time)),
child: Text()),
Align(
alignment: Alignment.centerLeft,
child: Text(l.room))
child: Text))
])),
Spacer(),
ButtonTheme.bar(
//color:Colors.green,
// make buttons use the appropriate styles for cards
child: ButtonBar(
children: <Widget>[
IconButton(
icon: l.like
? Icon(Icons.favorite)
: Icon(Icons.favorite_border),
tooltip: 'blah',
onPressed: () {
setState(() {
l.like = !l.like;
});
}),
],
),
),
],
),
)));
} else {
return Container(height: pxFromDureation(l.start, l.end));
}
}
}
Spacer(),*/
class LectureCard extends StatefulWidget {
final Lecture lecture;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment