kopia lustrzana https://gitlab.com/mysocialportal/relatica
Style status cards with dropshadows and better colors
rodzic
b30ba7c057
commit
31e41239e7
|
@ -55,51 +55,67 @@ class _StatusControlState extends State<FlattenedTreeEntryControl> {
|
|||
const otherPadding = 8.0;
|
||||
final leftPadding = otherPadding + (widget.originalItem.level * 15.0);
|
||||
final color = widget.originalItem.level.isOdd
|
||||
? Theme.of(context).splashColor
|
||||
: Theme.of(context).cardColor;
|
||||
final body = Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
StatusHeaderControl(
|
||||
entry: entry,
|
||||
),
|
||||
const VerticalPadding(
|
||||
height: 5,
|
||||
),
|
||||
if (entry.spoilerText.isNotEmpty)
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
showContent = !showContent;
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
'Content Summary: ${entry.spoilerText} (Click to ${showContent ? "Hide" : "Show"}}')),
|
||||
if (showContent) ...[
|
||||
buildBody(context),
|
||||
? Theme.of(context).secondaryHeaderColor
|
||||
: Theme.of(context).dialogBackgroundColor;
|
||||
final body = Container(
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
border: Border.all(width: 0.5),
|
||||
borderRadius: BorderRadius.circular(5.0),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Theme.of(context).dividerColor,
|
||||
blurRadius: 2,
|
||||
offset: Offset(4, 4),
|
||||
spreadRadius: 0.1,
|
||||
blurStyle: BlurStyle.normal,
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
StatusHeaderControl(
|
||||
entry: entry,
|
||||
),
|
||||
const VerticalPadding(
|
||||
height: 5,
|
||||
),
|
||||
if (entry.spoilerText.isNotEmpty)
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
showContent = !showContent;
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
'Content Summary: ${entry.spoilerText} (Click to ${showContent ? "Hide" : "Show"}}')),
|
||||
if (showContent) ...[
|
||||
buildBody(context),
|
||||
const VerticalPadding(
|
||||
height: 5,
|
||||
),
|
||||
if (entry.linkPreviewData != null)
|
||||
LinkPreviewControl(preview: entry.linkPreviewData!),
|
||||
buildMediaBar(context),
|
||||
],
|
||||
const VerticalPadding(
|
||||
height: 5,
|
||||
),
|
||||
InteractionsBarControl(
|
||||
entry: entry,
|
||||
isMine: item.isMine,
|
||||
openRemote: widget.openRemote,
|
||||
showOpenControl: widget.showStatusOpenButton,
|
||||
),
|
||||
const VerticalPadding(
|
||||
height: 5,
|
||||
),
|
||||
if (entry.linkPreviewData != null)
|
||||
LinkPreviewControl(preview: entry.linkPreviewData!),
|
||||
buildMediaBar(context),
|
||||
],
|
||||
const VerticalPadding(
|
||||
height: 5,
|
||||
),
|
||||
InteractionsBarControl(
|
||||
entry: entry,
|
||||
isMine: item.isMine,
|
||||
openRemote: widget.openRemote,
|
||||
showOpenControl: widget.showStatusOpenButton,
|
||||
),
|
||||
const VerticalPadding(
|
||||
height: 5,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return Padding(
|
||||
|
@ -109,7 +125,7 @@ class _StatusControlState extends State<FlattenedTreeEntryControl> {
|
|||
top: otherPadding,
|
||||
bottom: otherPadding,
|
||||
),
|
||||
child: isPost ? body : Card(color: color, child: body),
|
||||
child: body,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue