mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
@@ -556,6 +556,56 @@ Widget addWidget(
|
|||||||
|
|
||||||
case 'ADDITIONAL_TYPE_MATCH':
|
case 'ADDITIONAL_TYPE_MATCH':
|
||||||
final content = additional.match!;
|
final content = additional.match!;
|
||||||
|
Widget teamItem(TTeam team, Alignment alignment, EdgeInsets padding) {
|
||||||
|
return Expanded(
|
||||||
|
child: Align(
|
||||||
|
alignment: alignment,
|
||||||
|
child: Padding(
|
||||||
|
padding: padding,
|
||||||
|
child: Column(
|
||||||
|
spacing: 5,
|
||||||
|
mainAxisSize: .min,
|
||||||
|
children: [
|
||||||
|
NetworkImgLayer(
|
||||||
|
radius: 0,
|
||||||
|
width: 30,
|
||||||
|
height: 30,
|
||||||
|
src: team.pic,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: .ellipsis,
|
||||||
|
team.name!,
|
||||||
|
style: const TextStyle(fontSize: 13),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Widget? title;
|
||||||
|
if (content.matchInfo?.title?.isNotEmpty == true) {
|
||||||
|
title = Text(
|
||||||
|
content.matchInfo!.title!,
|
||||||
|
style: const TextStyle(fontSize: 13),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (content.matchInfo?.subTitle?.isNotEmpty == true) {
|
||||||
|
title = Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
?title,
|
||||||
|
Text(
|
||||||
|
content.matchInfo!.subTitle!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: theme.colorScheme.outline,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
child = InkWell(
|
child = InkWell(
|
||||||
borderRadius: borderRadius,
|
borderRadius: borderRadius,
|
||||||
onTap: content.jumpUrl == null
|
onTap: content.jumpUrl == null
|
||||||
@@ -565,43 +615,13 @@ Widget addWidget(
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Column(
|
?title,
|
||||||
mainAxisSize: MainAxisSize.min,
|
if (content.matchInfo?.leftTeam != null)
|
||||||
children: [
|
teamItem(
|
||||||
if (content.matchInfo?.title?.isNotEmpty == true)
|
content.matchInfo!.leftTeam!,
|
||||||
Text(
|
Alignment.centerRight,
|
||||||
content.matchInfo!.title!,
|
const .only(right: 16),
|
||||||
style: const TextStyle(fontSize: 13),
|
|
||||||
),
|
|
||||||
if (content.matchInfo?.subTitle?.isNotEmpty == true)
|
|
||||||
Text(
|
|
||||||
content.matchInfo!.subTitle!,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13,
|
|
||||||
color: theme.colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
if (content.matchInfo?.leftTeam != null) ...[
|
|
||||||
Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
NetworkImgLayer(
|
|
||||||
width: 30,
|
|
||||||
height: 30,
|
|
||||||
src: content.matchInfo!.leftTeam!.pic,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
content.matchInfo!.leftTeam!.name!,
|
|
||||||
style: const TextStyle(fontSize: 13),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
|
||||||
],
|
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
if (content.matchInfo?.centerTop?.isNotEmpty == true)
|
if (content.matchInfo?.centerTop?.isNotEmpty == true)
|
||||||
@@ -626,25 +646,12 @@ Widget addWidget(
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (content.matchInfo?.rightTeam != null) ...[
|
if (content.matchInfo?.rightTeam != null)
|
||||||
const SizedBox(width: 16),
|
teamItem(
|
||||||
Column(
|
content.matchInfo!.rightTeam!,
|
||||||
mainAxisSize: MainAxisSize.min,
|
Alignment.centerLeft,
|
||||||
children: [
|
const .only(left: 16),
|
||||||
NetworkImgLayer(
|
|
||||||
width: 30,
|
|
||||||
height: 30,
|
|
||||||
src: content.matchInfo!.rightTeam!.pic,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
content.matchInfo!.rightTeam!.name!,
|
|
||||||
style: const TextStyle(fontSize: 13),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
|
||||||
const Spacer(),
|
|
||||||
if (content.button case final button?)
|
if (content.button case final button?)
|
||||||
FilledButton.tonal(
|
FilledButton.tonal(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
|
|||||||
Reference in New Issue
Block a user