Merge branch 'main' into feature-m3Design
This commit is contained in:
@ -19,7 +19,10 @@ class ReplyContent {
|
|||||||
Map? richText;
|
Map? richText;
|
||||||
|
|
||||||
ReplyContent.fromJson(Map<String, dynamic> json) {
|
ReplyContent.fromJson(Map<String, dynamic> json) {
|
||||||
message = json['message'].replaceAll('>', '>').replaceAll('"', '"');
|
message = json['message']
|
||||||
|
.replaceAll('>', '>')
|
||||||
|
.replaceAll('"', '"')
|
||||||
|
.replaceAll(''', "'");
|
||||||
atNameToMid = json['at_name_to_mid'] ?? {};
|
atNameToMid = json['at_name_to_mid'] ?? {};
|
||||||
memebers = json['memebers'] ?? [];
|
memebers = json['memebers'] ?? [];
|
||||||
emote = json['emote'] ?? {};
|
emote = json['emote'] ?? {};
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -340,7 +341,14 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(widget.videoDetail!.bvid!),
|
Text(widget.videoDetail!.bvid!),
|
||||||
Text(widget.videoDetail!.desc!),
|
Text.rich(
|
||||||
|
TextSpan(
|
||||||
|
children: [
|
||||||
|
buildContent(
|
||||||
|
context, widget.videoDetail!),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -536,6 +544,42 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InlineSpan buildContent(BuildContext context, content) {
|
||||||
|
String desc = content.desc;
|
||||||
|
List descV2 = content.descV2;
|
||||||
|
// type
|
||||||
|
// 1 普通文本
|
||||||
|
// 2 @用户
|
||||||
|
List<InlineSpan> spanChilds = [];
|
||||||
|
if (descV2.isNotEmpty) {
|
||||||
|
for (var i = 0; i < descV2.length; i++) {
|
||||||
|
if (descV2[i].type == 1) {
|
||||||
|
spanChilds.add(TextSpan(text: descV2[i].rawText));
|
||||||
|
} else if (descV2[i].type == 2) {
|
||||||
|
spanChilds.add(
|
||||||
|
TextSpan(
|
||||||
|
text: '@${descV2[i].rawText}',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
recognizer: TapGestureRecognizer()
|
||||||
|
..onTap = () {
|
||||||
|
String heroTag = Utils.makeHeroTag(descV2[i].bizId);
|
||||||
|
Get.toNamed(
|
||||||
|
'/member?mid=${descV2[i].bizId}',
|
||||||
|
arguments: {'face': '', 'heroTag': heroTag},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
spanChilds.add(TextSpan(text: desc));
|
||||||
|
}
|
||||||
|
return TextSpan(children: spanChilds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ActionItem extends StatelessWidget {
|
class ActionItem extends StatelessWidget {
|
||||||
|
Reference in New Issue
Block a user