mod: 直播功能注释
This commit is contained in:
@ -27,7 +27,7 @@ InlineSpan richNode(item, context) {
|
|||||||
} else {
|
} else {
|
||||||
for (var i in richTextNodes) {
|
for (var i in richTextNodes) {
|
||||||
/// fix 渲染专栏时内容会重复
|
/// fix 渲染专栏时内容会重复
|
||||||
if (item.modules.moduleDynamic.major?.opus?.title == null &&
|
if (item.modules.moduleDynamic.major.opus.title == null &&
|
||||||
i.type == 'RICH_TEXT_NODE_TYPE_TEXT') {
|
i.type == 'RICH_TEXT_NODE_TYPE_TEXT') {
|
||||||
spanChilds.add(
|
spanChilds.add(
|
||||||
TextSpan(text: i.origText, style: const TextStyle(height: 1.65)));
|
TextSpan(text: i.origText, style: const TextStyle(height: 1.65)));
|
||||||
@ -193,116 +193,122 @@ InlineSpan richNode(item, context) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
if (contentType == 'major' &&
|
||||||
if (contentType == 'major' &&
|
item.modules.moduleDynamic.major.opus.pics.isNotEmpty) {
|
||||||
item.modules.moduleDynamic.major.opus.pics.isNotEmpty) {
|
// 图片可能跟其他widget重复渲染
|
||||||
// 图片可能跟其他widget重复渲染
|
List<OpusPicsModel> pics = item.modules.moduleDynamic.major.opus.pics;
|
||||||
List<OpusPicsModel> pics = item.modules.moduleDynamic.major.opus.pics;
|
int len = pics.length;
|
||||||
int len = pics.length;
|
List<String> picList = [];
|
||||||
List picList = [];
|
|
||||||
|
|
||||||
if (len == 1) {
|
if (len == 1) {
|
||||||
OpusPicsModel pictureItem = pics.first;
|
OpusPicsModel pictureItem = pics.first;
|
||||||
picList.add(pictureItem.url);
|
picList.add(pictureItem.url!);
|
||||||
spanChilds.add(const TextSpan(text: '\n'));
|
spanChilds.add(const TextSpan(text: '\n'));
|
||||||
spanChilds.add(
|
spanChilds.add(
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
builder: (context, BoxConstraints box) {
|
builder: (context, BoxConstraints box) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed('/preview',
|
showDialog(
|
||||||
arguments: {'initialPage': 0, 'imgList': picList});
|
useSafeArea: false,
|
||||||
},
|
context: context,
|
||||||
child: Padding(
|
builder: (context) {
|
||||||
padding: const EdgeInsets.only(top: 4),
|
return ImagePreview(initialPage: 0, imgList: picList);
|
||||||
child: NetworkImgLayer(
|
},
|
||||||
src: pictureItem.url,
|
);
|
||||||
width: box.maxWidth / 2,
|
},
|
||||||
height: box.maxWidth *
|
child: Padding(
|
||||||
0.5 *
|
padding: const EdgeInsets.only(top: 4),
|
||||||
pictureItem.height! /
|
|
||||||
pictureItem.width!,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (len > 1) {
|
|
||||||
List<Widget> list = [];
|
|
||||||
for (var i = 0; i < len; i++) {
|
|
||||||
picList.add(pics[i].url);
|
|
||||||
list.add(
|
|
||||||
LayoutBuilder(
|
|
||||||
builder: (context, BoxConstraints box) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Get.toNamed('/preview',
|
|
||||||
arguments: {'initialPage': i, 'imgList': picList});
|
|
||||||
},
|
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: pics[i].url,
|
src: pictureItem.url,
|
||||||
width: box.maxWidth,
|
width: box.maxWidth / 2,
|
||||||
height: box.maxWidth,
|
height: box.maxWidth *
|
||||||
|
0.5 *
|
||||||
|
pictureItem.height! /
|
||||||
|
pictureItem.width!,
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
),
|
},
|
||||||
);
|
),
|
||||||
}
|
),
|
||||||
spanChilds.add(
|
);
|
||||||
WidgetSpan(
|
}
|
||||||
child: LayoutBuilder(
|
if (len > 1) {
|
||||||
builder: (context, BoxConstraints box) {
|
List<Widget> list = [];
|
||||||
double maxWidth = box.maxWidth;
|
for (var i = 0; i < len; i++) {
|
||||||
double crossCount = len < 3 ? 2 : 3;
|
picList.add(pics[i].url!);
|
||||||
double height = maxWidth /
|
list.add(
|
||||||
crossCount *
|
LayoutBuilder(
|
||||||
(len % crossCount == 0
|
builder: (context, BoxConstraints box) {
|
||||||
? len ~/ crossCount
|
return GestureDetector(
|
||||||
: len ~/ crossCount + 1) +
|
onTap: () {
|
||||||
6;
|
showDialog(
|
||||||
return Container(
|
useSafeArea: false,
|
||||||
padding: const EdgeInsets.only(top: 6),
|
context: context,
|
||||||
height: height,
|
builder: (context) {
|
||||||
child: GridView.count(
|
return ImagePreview(initialPage: i, imgList: picList);
|
||||||
padding: EdgeInsets.zero,
|
},
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
);
|
||||||
crossAxisCount: crossCount.toInt(),
|
},
|
||||||
mainAxisSpacing: 4.0,
|
child: NetworkImgLayer(
|
||||||
crossAxisSpacing: 4.0,
|
src: pics[i].url,
|
||||||
childAspectRatio: 1,
|
width: box.maxWidth,
|
||||||
children: list,
|
height: box.maxWidth,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// spanChilds.add(
|
spanChilds.add(
|
||||||
// WidgetSpan(
|
WidgetSpan(
|
||||||
// child: NetworkImgLayer(
|
child: LayoutBuilder(
|
||||||
// src: pics.first.url,
|
builder: (context, BoxConstraints box) {
|
||||||
// type: 'emote',
|
double maxWidth = box.maxWidth;
|
||||||
// width: 100,
|
double crossCount = len < 3 ? 2 : 3;
|
||||||
// height: 200,
|
double height = maxWidth /
|
||||||
// ),
|
crossCount *
|
||||||
// ),
|
(len % crossCount == 0
|
||||||
// );
|
? len ~/ crossCount
|
||||||
|
: len ~/ crossCount + 1) +
|
||||||
|
6;
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.only(top: 6),
|
||||||
|
height: height,
|
||||||
|
child: GridView.count(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
crossAxisCount: crossCount.toInt(),
|
||||||
|
mainAxisSpacing: 4.0,
|
||||||
|
crossAxisSpacing: 4.0,
|
||||||
|
childAspectRatio: 1,
|
||||||
|
children: list,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
// spanChilds.add(
|
||||||
print('❌rich_node_panel err: $err');
|
// WidgetSpan(
|
||||||
|
// child: NetworkImgLayer(
|
||||||
|
// src: pics.first.url,
|
||||||
|
// type: 'emote',
|
||||||
|
// width: 100,
|
||||||
|
// height: 200,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
return TextSpan(
|
return TextSpan(
|
||||||
children: spanChilds,
|
children: spanChilds,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
print('❌❌rich_node_panel err: $err');
|
print('❌rich_node_panel err: $err');
|
||||||
return spacer;
|
return spacer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,39 +58,37 @@ class _BottomControlState extends State<BottomControl> {
|
|||||||
titleSpacing: 14,
|
titleSpacing: 14,
|
||||||
title: Row(
|
title: Row(
|
||||||
children: [
|
children: [
|
||||||
ComBtn(
|
// ComBtn(
|
||||||
icon: const Icon(
|
// icon: const Icon(
|
||||||
Icons.subtitles_outlined,
|
// Icons.subtitles_outlined,
|
||||||
size: 18,
|
// size: 18,
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
),
|
// ),
|
||||||
fuc: () => Get.back(),
|
// fuc: () => Get.back(),
|
||||||
),
|
// ),
|
||||||
const SizedBox(width: 4),
|
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
const SizedBox(width: 4),
|
// ComBtn(
|
||||||
ComBtn(
|
// icon: const Icon(
|
||||||
icon: const Icon(
|
// Icons.hd_outlined,
|
||||||
Icons.hd_outlined,
|
// size: 18,
|
||||||
size: 18,
|
// color: Colors.white,
|
||||||
color: Colors.white,
|
// ),
|
||||||
),
|
// fuc: () => {},
|
||||||
fuc: () => {},
|
// ),
|
||||||
),
|
// const SizedBox(width: 4),
|
||||||
const SizedBox(width: 4),
|
// Obx(
|
||||||
Obx(
|
// () => ComBtn(
|
||||||
() => ComBtn(
|
// icon: Icon(
|
||||||
icon: Icon(
|
// widget.liveRoomCtr!.volumeOff.value
|
||||||
widget.liveRoomCtr!.volumeOff.value
|
// ? Icons.volume_off_outlined
|
||||||
? Icons.volume_off_outlined
|
// : Icons.volume_up_outlined,
|
||||||
: Icons.volume_up_outlined,
|
// size: 18,
|
||||||
size: 18,
|
// color: Colors.white,
|
||||||
color: Colors.white,
|
// ),
|
||||||
),
|
// fuc: () => {},
|
||||||
fuc: () => {},
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// const SizedBox(width: 4),
|
||||||
const SizedBox(width: 4),
|
|
||||||
if (Platform.isAndroid) ...[
|
if (Platform.isAndroid) ...[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 34,
|
width: 34,
|
||||||
|
|||||||
Reference in New Issue
Block a user