opt: 专栏opus图片预览
This commit is contained in:
@ -109,6 +109,15 @@ class _OpusPageState extends State<OpusPage> {
|
|||||||
} else {
|
} else {
|
||||||
print('No moduleContent found');
|
print('No moduleContent found');
|
||||||
}
|
}
|
||||||
|
// 获取所有的图片链接
|
||||||
|
final List<String> picList = [];
|
||||||
|
for (var paragraph in moduleContent.paragraphs!) {
|
||||||
|
if (paragraph.paraType == 2) {
|
||||||
|
for (var pic in paragraph.pic!.pics!) {
|
||||||
|
picList.add(pic.url!);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.fromLTRB(16, 0, 16,
|
padding: EdgeInsets.fromLTRB(16, 0, 16,
|
||||||
MediaQuery.of(context).padding.bottom + 40),
|
MediaQuery.of(context).padding.bottom + 40),
|
||||||
@ -170,14 +179,10 @@ class _OpusPageState extends State<OpusPage> {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
onPreviewImg(
|
onPreviewImg(
|
||||||
paragraph.pic!.pics!
|
picList,
|
||||||
.map((pic) => pic.url)
|
picList.indexOf(pic.url!),
|
||||||
.toList(),
|
context,
|
||||||
paragraph.pic!.pics!
|
);
|
||||||
.indexWhere((pic) =>
|
|
||||||
pic.url ==
|
|
||||||
pic.url),
|
|
||||||
context);
|
|
||||||
},
|
},
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: pic.url,
|
src: pic.url,
|
||||||
|
|||||||
Reference in New Issue
Block a user