new content types applied
This commit is contained in:
parent
3c8a9fea22
commit
0d889c7a20
|
|
@ -4,6 +4,8 @@ class Content {
|
||||||
final String? audio;
|
final String? audio;
|
||||||
final String? video;
|
final String? video;
|
||||||
final String? image;
|
final String? image;
|
||||||
|
final String? largeImage;
|
||||||
|
final String? caption;
|
||||||
|
|
||||||
const Content({
|
const Content({
|
||||||
required this.order,
|
required this.order,
|
||||||
|
|
@ -11,6 +13,8 @@ class Content {
|
||||||
required this.audio,
|
required this.audio,
|
||||||
required this.video,
|
required this.video,
|
||||||
required this.image,
|
required this.image,
|
||||||
|
required this.largeImage,
|
||||||
|
required this.caption,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory Content.fromJson(Map<String, dynamic> json) => Content(
|
factory Content.fromJson(Map<String, dynamic> json) => Content(
|
||||||
|
|
@ -19,6 +23,8 @@ class Content {
|
||||||
audio: json['audio'],
|
audio: json['audio'],
|
||||||
video: json['video'],
|
video: json['video'],
|
||||||
image: json['image'],
|
image: json['image'],
|
||||||
|
largeImage: json['largeImage'],
|
||||||
|
caption: json['caption'],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
|
|
@ -27,5 +33,7 @@ class Content {
|
||||||
'audio': audio,
|
'audio': audio,
|
||||||
'video': video,
|
'video': video,
|
||||||
'image': image,
|
'image': image,
|
||||||
|
'largeImage': largeImage,
|
||||||
|
'caption': caption,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,13 +190,17 @@ class _DidvanPageViewState extends State<DidvanPageView> {
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
padding: 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) {
|
if (content.image != null) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|
@ -209,7 +213,7 @@ class _DidvanPageViewState extends State<DidvanPageView> {
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SkeletonImage(
|
child: SkeletonImage(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
imageUrl: content.image,
|
imageUrl: content.largeImage ?? content.image,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue