Commit c2cbb2f5 authored by Wilko Manger's avatar Wilko Manger

Add margin if chat item is first item in timeline

parent 488f129c
......@@ -116,16 +116,4 @@ abstract class Bubble extends Item {
@override
Widget build(BuildContext context);
@protected
double marginBottom() => Item.betweenMargin;
@protected
double marginTop() {
if (previousItem == null) {
return Item.betweenMargin;
} else {
return 0;
}
}
}
\ No newline at end of file
......@@ -51,11 +51,5 @@ abstract class Item extends StatelessWidget {
double marginBottom() => betweenMargin;
@protected
double marginTop() {
if (previousItem == null) {
return betweenMargin;
} else {
return 0;
}
}
double marginTop() => previousItem == null ? betweenMargin : 0;
}
\ No newline at end of file
......@@ -59,7 +59,8 @@ abstract class StateBubble extends Bubble {
padding: EdgeInsets.only(
left: Item.sideMargin,
right: Item.sideMargin,
bottom: Item.betweenMargin
bottom: marginBottom(),
top: marginTop()
),
child: Material(
elevation: 1,
......
......@@ -87,6 +87,5 @@ abstract class Subtitle extends StatelessWidget {
} else {
return Container(height: 0, width: 0);
}
}
}
\ No newline at end of file
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