image captions now work with new api

This commit is contained in:
MohammadTaha Basiri 2022-03-09 18:08:18 +03:30
parent 71a5bda8c9
commit 9d4ec78b23
1 changed files with 38 additions and 33 deletions

View File

@ -193,16 +193,11 @@ 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) { if (content.image != null) {
return GestureDetector( return Column(
children: [
GestureDetector(
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
@ -231,6 +226,16 @@ class _DidvanPageViewState extends State<DidvanPageView> {
imageUrl: content.image!, imageUrl: content.image!,
width: double.infinity, width: double.infinity,
), ),
),
if (content.caption != null)
Center(
child: DidvanText(
content.caption,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.caption,
),
),
],
); );
} }
return const SizedBox(); return const SizedBox();