feat: Added pageview animation when picture modal clicked
This commit is contained in:
@@ -169,6 +169,14 @@ class _FullScreenMediaState extends State<FullScreenMedia>
|
|||||||
mediaAttachments: widget.mediaAttachments,
|
mediaAttachments: widget.mediaAttachments,
|
||||||
message: widget.message,
|
message: widget.message,
|
||||||
videoPackages: videoPackages,
|
videoPackages: videoPackages,
|
||||||
|
mediaSelectedCallBack: (val) {
|
||||||
|
setState(() {
|
||||||
|
_currentPage = val;
|
||||||
|
_pageController.animateToPage(val,
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
curve: Curves.easeInOut);
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
+25
-13
@@ -36,6 +36,7 @@ class ImageFooter extends StatefulWidget {
|
|||||||
final Message message;
|
final Message message;
|
||||||
|
|
||||||
final List<VideoPackage> videoPackages;
|
final List<VideoPackage> videoPackages;
|
||||||
|
final ValueChanged<int> mediaSelectedCallBack;
|
||||||
|
|
||||||
/// Creates a channel header
|
/// Creates a channel header
|
||||||
ImageFooter({
|
ImageFooter({
|
||||||
@@ -48,6 +49,7 @@ class ImageFooter extends StatefulWidget {
|
|||||||
this.mediaAttachments,
|
this.mediaAttachments,
|
||||||
this.message,
|
this.message,
|
||||||
this.videoPackages,
|
this.videoPackages,
|
||||||
|
this.mediaSelectedCallBack,
|
||||||
}) : preferredSize = Size.fromHeight(kToolbarHeight),
|
}) : preferredSize = Size.fromHeight(kToolbarHeight),
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
@@ -213,23 +215,33 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
videoAttachments
|
videoAttachments
|
||||||
.indexOf(widget.mediaAttachments[position])];
|
.indexOf(widget.mediaAttachments[position])];
|
||||||
|
|
||||||
return FittedBox(
|
return InkWell(
|
||||||
child: Chewie(
|
onTap: () {
|
||||||
controller: controllerPackage.chewieController,
|
widget.mediaSelectedCallBack(position);
|
||||||
|
},
|
||||||
|
child: FittedBox(
|
||||||
|
child: Chewie(
|
||||||
|
controller: controllerPackage.chewieController,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Padding(
|
return InkWell(
|
||||||
padding: const EdgeInsets.all(1.0),
|
onTap: () {
|
||||||
child: AspectRatio(
|
widget.mediaSelectedCallBack(position);
|
||||||
child: CachedNetworkImage(
|
},
|
||||||
imageUrl:
|
child: Padding(
|
||||||
widget.mediaAttachments[position].imageUrl ??
|
padding: const EdgeInsets.all(1.0),
|
||||||
widget.mediaAttachments[position].assetUrl ??
|
child: AspectRatio(
|
||||||
widget.mediaAttachments[position].thumbUrl,
|
child: CachedNetworkImage(
|
||||||
fit: BoxFit.cover,
|
imageUrl: widget
|
||||||
|
.mediaAttachments[position].imageUrl ??
|
||||||
|
widget.mediaAttachments[position].assetUrl ??
|
||||||
|
widget.mediaAttachments[position].thumbUrl,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
aspectRatio: 1.0,
|
||||||
),
|
),
|
||||||
aspectRatio: 1.0,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user