Created
January 12, 2021 23:04
-
-
Save jtmuller5/f9230ad629f3edceba1e2c5a47a053bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VideoControlOverlay extends ViewModelWidget<StackedVideoViewModel> { | |
@override | |
Widget build(BuildContext context, StackedVideoViewModel model) { | |
return Container( | |
height: model.thumbnailHeight, | |
width: model.thumbnailWidth, | |
child: Stack( | |
children: <Widget>[ | |
AnimatedSwitcher( | |
duration: Duration(milliseconds: 50), | |
reverseDuration: Duration(milliseconds: 200), | |
child: model.videoPlayerController.value.isPlaying | |
? SizedBox.shrink() | |
: Container( | |
color: Colors.black26, | |
child: Center( | |
child: Icon( | |
Icons.play_arrow, | |
color: Colors.white, | |
size: model.thumbnailHeight/4, | |
), | |
), | |
), | |
), | |
GestureDetector( | |
onTap: () { | |
model.videoPlayerController.value.isPlaying | |
? model.pauseVideo() | |
: model.playVideo(); | |
}, | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment