diff --git a/lib/models/content.dart b/lib/models/content.dart index aa431e1..3ec25fe 100644 --- a/lib/models/content.dart +++ b/lib/models/content.dart @@ -4,6 +4,8 @@ class Content { final String? audio; final String? video; final String? image; + final String? largeImage; + final String? caption; const Content({ required this.order, @@ -11,6 +13,8 @@ class Content { required this.audio, required this.video, required this.image, + required this.largeImage, + required this.caption, }); factory Content.fromJson(Map json) => Content( @@ -19,6 +23,8 @@ class Content { audio: json['audio'], video: json['video'], image: json['image'], + largeImage: json['largeImage'], + caption: json['caption'], ); Map toJson() => { @@ -27,5 +33,7 @@ class Content { 'audio': audio, 'video': video, 'image': image, + 'largeImage': largeImage, + 'caption': caption, }; } diff --git a/lib/views/widgets/didvan/page_view.dart b/lib/views/widgets/didvan/page_view.dart index aba3078..799c62e 100644 --- a/lib/views/widgets/didvan/page_view.dart +++ b/lib/views/widgets/didvan/page_view.dart @@ -190,13 +190,17 @@ class _DidvanPageViewState extends State { margin: EdgeInsets.zero, padding: EdgeInsets.zero, ), - 'span': Style( - textAlign: TextAlign.center, - fontSize: FontSize.small, - ), }, ); } + if (content.caption != null) { + return Center( + child: DidvanText( + content.caption, + style: Theme.of(context).textTheme.caption, + ), + ); + } if (content.image != null) { return GestureDetector( onTap: () { @@ -209,7 +213,7 @@ class _DidvanPageViewState extends State { child: Center( child: SkeletonImage( width: MediaQuery.of(context).size.width, - imageUrl: content.image, + imageUrl: content.largeImage ?? content.image, ), ), ),