mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-20 16:18:39 +00:00
improve handle opus nullType
Closes #2148 Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -81,9 +81,7 @@ class OpusContent extends StatelessWidget {
|
|||||||
// case 'RICH_TEXT_NODE_TYPE_TOPIC':
|
// case 'RICH_TEXT_NODE_TYPE_TOPIC':
|
||||||
default:
|
default:
|
||||||
if (rich.jumpUrl != null) {
|
if (rich.jumpUrl != null) {
|
||||||
PiliScheme.routePushFromUrl(
|
PiliScheme.routePushFromUrl(rich.jumpUrl!);
|
||||||
rich.jumpUrl!,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -100,7 +98,7 @@ class OpusContent extends StatelessWidget {
|
|||||||
colorScheme.onSurfaceVariant,
|
colorScheme.onSurfaceVariant,
|
||||||
BlendMode.srcIn,
|
BlendMode.srcIn,
|
||||||
),
|
),
|
||||||
alignment: Alignment.centerLeft,
|
alignment: .centerLeft,
|
||||||
placeholderBuilder: (_) => Text(latex),
|
placeholderBuilder: (_) => Text(latex),
|
||||||
errorBuilder: (_) => Text(latex),
|
errorBuilder: (_) => Text(latex),
|
||||||
),
|
),
|
||||||
@@ -281,7 +279,7 @@ class OpusContent extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const WidgetSpan(
|
const WidgetSpan(
|
||||||
child: Icon(MdiIcons.circleMedium),
|
child: Icon(MdiIcons.circleMedium),
|
||||||
alignment: PlaceholderAlignment.middle,
|
alignment: .middle,
|
||||||
),
|
),
|
||||||
...entry.$2.nodes!.map((item) {
|
...entry.$2.nodes!.map((item) {
|
||||||
if (item.word != null) {
|
if (item.word != null) {
|
||||||
@@ -318,66 +316,69 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
case 6:
|
case 6:
|
||||||
return Material(
|
final type = element.linkCard!.card!.type;
|
||||||
shape: const RoundedRectangleBorder(
|
Widget child;
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
switch (type) {
|
||||||
|
case 'LINK_CARD_TYPE_UGC':
|
||||||
|
final ugc = element.linkCard!.card!.ugc!;
|
||||||
|
child = Row(
|
||||||
|
spacing: 10,
|
||||||
|
children: [
|
||||||
|
NetworkImgLayer(
|
||||||
|
width: 104,
|
||||||
|
height: 65,
|
||||||
|
src: ugc.cover,
|
||||||
|
borderRadius: const .all(.circular(6)),
|
||||||
),
|
),
|
||||||
color: colorScheme.onInverseSurface,
|
Expanded(
|
||||||
child: InkWell(
|
child: Column(
|
||||||
onTap: element.linkCard!.card!.type == 'LINK_CARD_TYPE_GOODS'
|
crossAxisAlignment: .start,
|
||||||
? null
|
children: [
|
||||||
: () {
|
Text(ugc.title!),
|
||||||
try {
|
Text(
|
||||||
if (element.linkCard!.card!.type ==
|
ugc.descSecond!,
|
||||||
'LINK_CARD_TYPE_VOTE') {
|
style: TextStyle(
|
||||||
showVoteDialog(
|
fontSize: 13,
|
||||||
context,
|
color: colorScheme.outline,
|
||||||
element.linkCard!.card!.vote?.voteId ??
|
),
|
||||||
int.parse(element.linkCard!.card!.oid!),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
return;
|
case 'LINK_CARD_TYPE_ITEM_NULL':
|
||||||
}
|
final itemNull = element.linkCard?.card?.itemNull;
|
||||||
String? url =
|
child = Text(
|
||||||
switch (element.linkCard!.card!.type) {
|
' ${itemNull?.text}: ${element.linkCard?.card?.oid}',
|
||||||
'LINK_CARD_TYPE_UGC' =>
|
);
|
||||||
element.linkCard!.card!.ugc!.jumpUrl,
|
case 'LINK_CARD_TYPE_COMMON':
|
||||||
'LINK_CARD_TYPE_COMMON' =>
|
final common = element.linkCard!.card!.common!;
|
||||||
element.linkCard!.card!.common!.jumpUrl,
|
child = Row(
|
||||||
'LINK_CARD_TYPE_LIVE' =>
|
|
||||||
element.linkCard!.card!.live!.jumpUrl,
|
|
||||||
'LINK_CARD_TYPE_OPUS' =>
|
|
||||||
element.linkCard!.card!.opus!.jumpUrl,
|
|
||||||
'LINK_CARD_TYPE_MUSIC' =>
|
|
||||||
element.linkCard!.card!.music!.jumpUrl,
|
|
||||||
_ => null,
|
|
||||||
};
|
|
||||||
if (url != null && url.isNotEmpty) {
|
|
||||||
PiliScheme.routePushFromUrl(url);
|
|
||||||
}
|
|
||||||
} catch (_) {}
|
|
||||||
},
|
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8),
|
|
||||||
child: switch (element.linkCard?.card?.type) {
|
|
||||||
'LINK_CARD_TYPE_UGC' => Row(
|
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 104,
|
width: 104,
|
||||||
height: 65,
|
height: 65,
|
||||||
src: element.linkCard!.card!.ugc!.cover,
|
src: common.cover,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const .all(.circular(6)),
|
||||||
Radius.circular(6),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: .start,
|
||||||
children: [
|
children: [
|
||||||
Text(element.linkCard!.card!.ugc!.title!),
|
Text(common.title!),
|
||||||
|
if (common.desc1 != null)
|
||||||
Text(
|
Text(
|
||||||
element.linkCard!.card!.ugc!.descSecond!,
|
common.desc1!,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: colorScheme.outline,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (common.desc2 != null)
|
||||||
|
Text(
|
||||||
|
common.desc2!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: colorScheme.outline,
|
color: colorScheme.outline,
|
||||||
@@ -387,49 +388,34 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
'LINK_CARD_TYPE_ITEM_NULL' => Row(
|
case 'LINK_CARD_TYPE_LIVE':
|
||||||
children: [
|
final live = element.linkCard!.card!.live!;
|
||||||
if (element
|
child = Row(
|
||||||
.linkCard
|
|
||||||
?.card
|
|
||||||
?.itemNull
|
|
||||||
?.icon
|
|
||||||
?.isNullOrEmpty ==
|
|
||||||
true)
|
|
||||||
const Icon(Icons.info, size: 20),
|
|
||||||
Text(' ${element.linkCard?.card?.itemNull?.text}'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
'LINK_CARD_TYPE_COMMON' => Row(
|
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 104,
|
width: 104,
|
||||||
height: 65,
|
height: 65,
|
||||||
src: element.linkCard!.card!.common!.cover,
|
src: live.cover,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const .all(.circular(6)),
|
||||||
Radius.circular(6),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: .start,
|
||||||
children: [
|
children: [
|
||||||
Text(element.linkCard!.card!.common!.title!),
|
Text(live.title!),
|
||||||
if (element.linkCard!.card!.common!.desc1 !=
|
if (live.descFirst != null)
|
||||||
null)
|
|
||||||
Text(
|
Text(
|
||||||
element.linkCard!.card!.common!.desc1!,
|
live.descFirst!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: colorScheme.outline,
|
color: colorScheme.outline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (element.linkCard!.card!.common!.desc2 !=
|
if (live.descSecond != null)
|
||||||
null)
|
|
||||||
Text(
|
Text(
|
||||||
element.linkCard!.card!.common!.desc2!,
|
live.descSecond!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: colorScheme.outline,
|
color: colorScheme.outline,
|
||||||
@@ -439,36 +425,25 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
'LINK_CARD_TYPE_LIVE' => Row(
|
case 'LINK_CARD_TYPE_OPUS':
|
||||||
|
final opus = element.linkCard!.card!.opus!;
|
||||||
|
child = Row(
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 104,
|
width: 104,
|
||||||
height: 65,
|
height: 65,
|
||||||
src: element.linkCard!.card!.live!.cover,
|
src: opus.cover,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const .all(.circular(6)),
|
||||||
Radius.circular(6),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: .start,
|
||||||
children: [
|
children: [
|
||||||
Text(element.linkCard!.card!.live!.title!),
|
Text(opus.title!),
|
||||||
if (element.linkCard!.card!.live!.descFirst !=
|
|
||||||
null)
|
|
||||||
Text(
|
Text(
|
||||||
element.linkCard!.card!.live!.descFirst!,
|
'${opus.authorName} · ${opus.statView ?? 0}阅读',
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13,
|
|
||||||
color: colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (element.linkCard!.card!.live!.descSecond !=
|
|
||||||
null)
|
|
||||||
Text(
|
|
||||||
element.linkCard!.card!.live!.descSecond!,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: colorScheme.outline,
|
color: colorScheme.outline,
|
||||||
@@ -478,48 +453,20 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
'LINK_CARD_TYPE_OPUS' => Row(
|
case 'LINK_CARD_TYPE_VOTE':
|
||||||
spacing: 10,
|
final vote = element.linkCard!.card!.vote!;
|
||||||
children: [
|
child = Row(
|
||||||
NetworkImgLayer(
|
|
||||||
width: 104,
|
|
||||||
height: 65,
|
|
||||||
src: element.linkCard!.card!.opus!.cover,
|
|
||||||
borderRadius: const BorderRadius.all(
|
|
||||||
Radius.circular(6),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(element.linkCard!.card!.opus!.title!),
|
|
||||||
Text(
|
|
||||||
'${element.linkCard!.card!.opus!.authorName} · ${element.linkCard!.card!.opus!.statView ?? 0}阅读',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13,
|
|
||||||
color: colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
'LINK_CARD_TYPE_VOTE' => Row(
|
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const .all(.circular(6)),
|
||||||
Radius.circular(6),
|
|
||||||
),
|
|
||||||
color: colorScheme.secondaryContainer,
|
color: colorScheme.secondaryContainer,
|
||||||
),
|
),
|
||||||
width: 70,
|
width: 70,
|
||||||
height: 50,
|
height: 50,
|
||||||
alignment: Alignment.center,
|
alignment: .center,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.bar_chart_rounded,
|
Icons.bar_chart_rounded,
|
||||||
color: colorScheme.onSurfaceVariant,
|
color: colorScheme.onSurfaceVariant,
|
||||||
@@ -527,11 +474,11 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: .start,
|
||||||
children: [
|
children: [
|
||||||
Text(element.linkCard!.card!.vote!.desc!),
|
Text(vote.desc!),
|
||||||
Text(
|
Text(
|
||||||
'${element.linkCard!.card!.vote!.joinNum}人参与',
|
'${vote.joinNum}人参与',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: colorScheme.outline,
|
color: colorScheme.outline,
|
||||||
@@ -541,27 +488,26 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
'LINK_CARD_TYPE_MUSIC' => Row(
|
case 'LINK_CARD_TYPE_MUSIC':
|
||||||
|
final music = element.linkCard!.card!.music!;
|
||||||
|
child = Row(
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: 104,
|
width: 104,
|
||||||
height: 65,
|
height: 65,
|
||||||
src: element.linkCard!.card!.music!.cover,
|
src: music.cover,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const .all(.circular(6)),
|
||||||
Radius.circular(6),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: .start,
|
||||||
children: [
|
children: [
|
||||||
Text(element.linkCard!.card!.music!.title!),
|
Text(music.title!),
|
||||||
if (element.linkCard!.card!.music!.label !=
|
if (music.label != null)
|
||||||
null)
|
|
||||||
Text(
|
Text(
|
||||||
element.linkCard!.card!.music!.label!,
|
music.label!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: colorScheme.outline,
|
color: colorScheme.outline,
|
||||||
@@ -571,11 +517,11 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
'LINK_CARD_TYPE_GOODS' => Column(
|
case 'LINK_CARD_TYPE_GOODS':
|
||||||
children: element.linkCard!.card!.goods!.items!.map((
|
final goods = element.linkCard!.card!.goods!;
|
||||||
e,
|
child = Column(
|
||||||
) {
|
children: goods.items!.map((e) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (e.jumpUrl?.isNotEmpty == true) {
|
if (e.jumpUrl?.isNotEmpty == true) {
|
||||||
@@ -589,14 +535,11 @@ class OpusContent extends StatelessWidget {
|
|||||||
width: 104,
|
width: 104,
|
||||||
height: 65,
|
height: 65,
|
||||||
src: e.cover,
|
src: e.cover,
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const .all(.circular(6)),
|
||||||
Radius.circular(6),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment: .start,
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Text(e.name!),
|
Text(e.name!),
|
||||||
if (e.brief?.isNotEmpty == true)
|
if (e.brief?.isNotEmpty == true)
|
||||||
@@ -622,11 +565,66 @@ class OpusContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
throw UnimplementedError(
|
||||||
|
'\nparaType: ${element.paraType},\ncard type: $type',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Material(
|
||||||
|
shape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: .all(.circular(8)),
|
||||||
),
|
),
|
||||||
_ => throw UnimplementedError(
|
color: colorScheme.onInverseSurface,
|
||||||
'\nparaType: ${element.paraType},\ncard type: ${element.linkCard?.card?.type}',
|
child: InkWell(
|
||||||
),
|
onTap: type == 'LINK_CARD_TYPE_GOODS'
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
|
try {
|
||||||
|
if (type == 'LINK_CARD_TYPE_VOTE') {
|
||||||
|
showVoteDialog(
|
||||||
|
context,
|
||||||
|
element.linkCard!.card!.vote?.voteId ??
|
||||||
|
int.parse(element.linkCard!.card!.oid!),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (type == 'LINK_CARD_TYPE_ITEM_NULL') {
|
||||||
|
switch (element.linkCard?.card?.itemNull?.text) {
|
||||||
|
case '视频':
|
||||||
|
PiliScheme.videoPush(
|
||||||
|
int.parse(element.linkCard!.card!.oid!),
|
||||||
|
null,
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
PageUtils.pushDynFromId(
|
||||||
|
id: element.linkCard!.card!.oid!,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String? url = switch (type) {
|
||||||
|
'LINK_CARD_TYPE_UGC' =>
|
||||||
|
element.linkCard!.card!.ugc!.jumpUrl,
|
||||||
|
'LINK_CARD_TYPE_COMMON' =>
|
||||||
|
element.linkCard!.card!.common!.jumpUrl,
|
||||||
|
'LINK_CARD_TYPE_LIVE' =>
|
||||||
|
element.linkCard!.card!.live!.jumpUrl,
|
||||||
|
'LINK_CARD_TYPE_OPUS' =>
|
||||||
|
element.linkCard!.card!.opus!.jumpUrl,
|
||||||
|
'LINK_CARD_TYPE_MUSIC' =>
|
||||||
|
element.linkCard!.card!.music!.jumpUrl,
|
||||||
|
_ => null,
|
||||||
|
};
|
||||||
|
if (url != null && url.isNotEmpty) {
|
||||||
|
PiliScheme.routePushFromUrl(url);
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
},
|
},
|
||||||
|
borderRadius: const .all(.circular(8)),
|
||||||
|
child: Padding(
|
||||||
|
padding: const .all(8),
|
||||||
|
child: child,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -648,12 +646,12 @@ class OpusContent extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
.render(renderer);
|
.render(renderer);
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const .all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const .all(.circular(8)),
|
||||||
color: colorScheme.onInverseSurface,
|
color: colorScheme.onInverseSurface,
|
||||||
),
|
),
|
||||||
width: double.infinity,
|
width: .infinity,
|
||||||
child: SelectableText.rich(renderer.span!),
|
child: SelectableText.rich(renderer.span!),
|
||||||
);
|
);
|
||||||
case 8 when (element.heading?.nodes?.isNotEmpty == true):
|
case 8 when (element.heading?.nodes?.isNotEmpty == true):
|
||||||
@@ -691,7 +689,7 @@ class OpusContent extends StatelessWidget {
|
|||||||
return SelectableText(
|
return SelectableText(
|
||||||
'不支持的类型 (${element.paraType})',
|
'不支持的类型 (${element.paraType})',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: .bold,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -700,7 +698,7 @@ class OpusContent extends StatelessWidget {
|
|||||||
return SelectableText(
|
return SelectableText(
|
||||||
'错误的类型 $e',
|
'错误的类型 $e',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: .bold,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -723,7 +721,7 @@ Widget moduleBlockedItem(
|
|||||||
? null
|
? null
|
||||||
: BoxDecoration(
|
: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: .fill,
|
||||||
image: ResizeImage(
|
image: ResizeImage(
|
||||||
CachedNetworkImageProvider(
|
CachedNetworkImageProvider(
|
||||||
ImageUtils.thumbnailUrl(
|
ImageUtils.thumbnailUrl(
|
||||||
@@ -759,7 +757,7 @@ Widget moduleBlockedItem(
|
|||||||
return FilledButton.tonal(
|
return FilledButton.tonal(
|
||||||
style: FilledButton.styleFrom(
|
style: FilledButton.styleFrom(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
tapTargetSize: .shrinkWrap,
|
||||||
visualDensity: visualDensity,
|
visualDensity: visualDensity,
|
||||||
backgroundColor: theme.colorScheme.btnColor,
|
backgroundColor: theme.colorScheme.btnColor,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
@@ -771,7 +769,7 @@ Widget moduleBlockedItem(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: .min,
|
||||||
children: [
|
children: [
|
||||||
if (moduleBlocked.button!.icon?.isNotEmpty == true)
|
if (moduleBlocked.button!.icon?.isNotEmpty == true)
|
||||||
CachedNetworkImage(
|
CachedNetworkImage(
|
||||||
@@ -798,9 +796,9 @@ Widget moduleBlockedItem(
|
|||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: maxWidth,
|
height: maxWidth,
|
||||||
decoration: bgImg(maxWidth),
|
decoration: bgImg(maxWidth),
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const .all(12),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: .center,
|
||||||
children: [
|
children: [
|
||||||
if (moduleBlocked.icon != null)
|
if (moduleBlocked.icon != null)
|
||||||
icon(math.max(40, maxWidth / 7)),
|
icon(math.max(40, maxWidth / 7)),
|
||||||
@@ -830,16 +828,16 @@ Widget moduleBlockedItem(
|
|||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: bgImg(constraints.maxWidth),
|
decoration: bgImg(constraints.maxWidth),
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const .all(12),
|
||||||
child: Row(
|
child: Row(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
if (moduleBlocked.icon != null) icon(42),
|
if (moduleBlocked.icon != null) icon(42),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
|
mainAxisSize: .min,
|
||||||
|
crossAxisAlignment: .start,
|
||||||
children: [
|
children: [
|
||||||
if (moduleBlocked.title?.isNotEmpty == true)
|
if (moduleBlocked.title?.isNotEmpty == true)
|
||||||
Text(moduleBlocked.title!),
|
Text(moduleBlocked.title!),
|
||||||
@@ -862,9 +860,9 @@ Widget moduleBlockedItem(
|
|||||||
horizontal: -4,
|
horizontal: -4,
|
||||||
),
|
),
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(6)),
|
borderRadius: .all(.circular(6)),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
padding: const .symmetric(horizontal: 10),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -891,15 +889,15 @@ Widget opusCollection(ThemeData theme, ModuleCollection item) {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: .min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: .start,
|
||||||
children: [
|
children: [
|
||||||
Text(item.title!),
|
Text(item.title!),
|
||||||
Text.rich(
|
Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
alignment: PlaceholderAlignment.middle,
|
alignment: .middle,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
size: 18,
|
size: 18,
|
||||||
Icons.article_outlined,
|
Icons.article_outlined,
|
||||||
|
|||||||
Reference in New Issue
Block a user