image captions now work with new api
This commit is contained in:
parent
71a5bda8c9
commit
9d4ec78b23
|
|
@ -193,44 +193,49 @@ class _DidvanPageViewState extends State<DidvanPageView> {
|
|||
},
|
||||
);
|
||||
}
|
||||
if (content.caption != null) {
|
||||
return Center(
|
||||
child: DidvanText(
|
||||
content.caption,
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (content.image != null) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: InteractiveViewer(
|
||||
child: Center(
|
||||
child: SkeletonImage(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
imageUrl: content.largeImage ?? content.image,
|
||||
return Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: InteractiveViewer(
|
||||
child: Center(
|
||||
child: SkeletonImage(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
imageUrl: content.largeImage ?? content.image,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Positioned(
|
||||
right: 24,
|
||||
top: 24,
|
||||
child: _BackButton(),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Positioned(
|
||||
right: 24,
|
||||
top: 24,
|
||||
child: _BackButton(),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
child: SkeletonImage(
|
||||
imageUrl: content.image!,
|
||||
width: double.infinity,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: SkeletonImage(
|
||||
imageUrl: content.image!,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
if (content.caption != null)
|
||||
Center(
|
||||
child: DidvanText(
|
||||
content.caption,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
return const SizedBox();
|
||||
|
|
|
|||
Loading…
Reference in New Issue