mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 07:36:14 +08:00
opt: msg item
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -260,107 +260,104 @@ class ChatItem extends StatelessWidget {
|
|||||||
|
|
||||||
Widget msgTypeSysGroupAutoCreated_208(
|
Widget msgTypeSysGroupAutoCreated_208(
|
||||||
ThemeData theme, content, Color textColor) {
|
ThemeData theme, content, Color textColor) {
|
||||||
return Container(
|
return Center(
|
||||||
constraints: const BoxConstraints(maxWidth: 300.0),
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
constraints: const BoxConstraints(maxWidth: 400),
|
||||||
color: theme.colorScheme.secondaryContainer.withOpacity(0.4),
|
decoration: BoxDecoration(
|
||||||
borderRadius: const BorderRadius.only(
|
color: theme.colorScheme.onInverseSurface,
|
||||||
topLeft: Radius.circular(16),
|
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||||
topRight: Radius.circular(16),
|
|
||||||
bottomLeft: Radius.circular(6),
|
|
||||||
bottomRight: Radius.circular(16),
|
|
||||||
),
|
),
|
||||||
),
|
padding: const EdgeInsets.all(12),
|
||||||
padding: const EdgeInsets.all(12),
|
child: Column(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Text(
|
||||||
Text(
|
content['main_title'],
|
||||||
content['main_title'],
|
style: TextStyle(
|
||||||
style: TextStyle(
|
letterSpacing: 0.6,
|
||||||
letterSpacing: 0.6,
|
height: 1.5,
|
||||||
height: 1.5,
|
color: textColor,
|
||||||
color: textColor,
|
fontWeight: FontWeight.bold,
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
for (var i in content['sub_cards']) ...[
|
|
||||||
const SizedBox(height: 6),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
RegExp bvRegex =
|
|
||||||
RegExp(r'BV[0-9A-Za-z]{10}', caseSensitive: false);
|
|
||||||
Iterable<Match> matches = bvRegex.allMatches(i['jump_url']);
|
|
||||||
if (matches.isNotEmpty) {
|
|
||||||
Match match = matches.first;
|
|
||||||
String bvid = match.group(0)!;
|
|
||||||
try {
|
|
||||||
SmartDialog.showLoading();
|
|
||||||
final int cid = await SearchHttp.ab2c(bvid: bvid);
|
|
||||||
SmartDialog.dismiss<dynamic>().then(
|
|
||||||
(e) => PageUtils.toVideoPage('bvid=$bvid&cid=$cid',
|
|
||||||
arguments: <String, String?>{
|
|
||||||
'pic': i['cover_url'],
|
|
||||||
'heroTag': Utils.makeHeroTag(bvid),
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
} catch (err) {
|
|
||||||
SmartDialog.dismiss();
|
|
||||||
SmartDialog.showToast(err.toString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
SmartDialog.showToast('未匹配到 BV 号');
|
|
||||||
PageUtils.handleWebview(i['jump_url']);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
NetworkImgLayer(
|
|
||||||
width: 130,
|
|
||||||
height: 130 * 9 / 16,
|
|
||||||
src: i['cover_url'],
|
|
||||||
),
|
|
||||||
const SizedBox(width: 6),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
i['field1'],
|
|
||||||
maxLines: 2,
|
|
||||||
style: TextStyle(
|
|
||||||
letterSpacing: 0.6,
|
|
||||||
height: 1.5,
|
|
||||||
color: textColor,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
i['field2'],
|
|
||||||
style: TextStyle(
|
|
||||||
letterSpacing: 0.6,
|
|
||||||
height: 1.5,
|
|
||||||
color: textColor.withOpacity(0.6),
|
|
||||||
fontSize: 12,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
i['field3'],
|
|
||||||
style: TextStyle(
|
|
||||||
letterSpacing: 0.6,
|
|
||||||
height: 1.5,
|
|
||||||
color: textColor.withOpacity(0.6),
|
|
||||||
fontSize: 12,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
for (var i in content['sub_cards']) ...[
|
||||||
|
const SizedBox(height: 6),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
RegExp bvRegex =
|
||||||
|
RegExp(r'BV[0-9A-Za-z]{10}', caseSensitive: false);
|
||||||
|
Iterable<Match> matches = bvRegex.allMatches(i['jump_url']);
|
||||||
|
if (matches.isNotEmpty) {
|
||||||
|
Match match = matches.first;
|
||||||
|
String bvid = match.group(0)!;
|
||||||
|
try {
|
||||||
|
SmartDialog.showLoading();
|
||||||
|
final int cid = await SearchHttp.ab2c(bvid: bvid);
|
||||||
|
SmartDialog.dismiss<dynamic>().then(
|
||||||
|
(e) => PageUtils.toVideoPage('bvid=$bvid&cid=$cid',
|
||||||
|
arguments: <String, String?>{
|
||||||
|
'pic': i['cover_url'],
|
||||||
|
'heroTag': Utils.makeHeroTag(bvid),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
SmartDialog.dismiss();
|
||||||
|
SmartDialog.showToast(err.toString());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SmartDialog.showToast('未匹配到 BV 号');
|
||||||
|
PageUtils.handleWebview(i['jump_url']);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
NetworkImgLayer(
|
||||||
|
width: 130,
|
||||||
|
height: 130 * 9 / 16,
|
||||||
|
src: i['cover_url'],
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
i['field1'],
|
||||||
|
maxLines: 2,
|
||||||
|
style: TextStyle(
|
||||||
|
letterSpacing: 0.6,
|
||||||
|
height: 1.5,
|
||||||
|
color: textColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
i['field2'],
|
||||||
|
style: TextStyle(
|
||||||
|
letterSpacing: 0.6,
|
||||||
|
height: 1.5,
|
||||||
|
color: textColor.withOpacity(0.6),
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
i['field3'],
|
||||||
|
style: TextStyle(
|
||||||
|
letterSpacing: 0.6,
|
||||||
|
height: 1.5,
|
||||||
|
color: textColor.withOpacity(0.6),
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user