This file contains hidden or 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), |
This file contains hidden or 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 VideoThumbnail extends ViewModelWidget<StackedVideoViewModel> { | |
| @override | |
| Widget build(BuildContext context, StackedVideoViewModel model) { | |
| return Builder( | |
| builder: (context) { | |
| // If we want to show the full video, we need to scale it to fit the longest side | |
| if (model.showFull) { | |
| bool wideVideo = | |
| model.videoPlayerController.value.size.width > |
This file contains hidden or 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 StackedVideoView extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return ViewModelBuilder<StackedVideoViewModel>.reactive( | |
| viewModelBuilder: () => StackedVideoViewModel(), | |
| onModelReady: (model) { | |
| model.initialize( | |
| 'https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4'); | |
| }, | |
| builder: (context, model, child) { |
This file contains hidden or 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 StackedVideoView extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return ViewModelBuilder<StackedVideoViewModel>.reactive( | |
| viewModelBuilder: () => StackedVideoViewModel(), | |
| onModelReady: (model) { | |
| model.initialize('https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4'); | |
| }, | |
| builder: (context, model, child) { | |
| return Container( |
This file contains hidden or 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 StackedVideoViewModel extends BaseViewModel { | |
| VideoPlayerController videoPlayerController; | |
| void initialize(String videoUrl) { | |
| videoPlayerController = VideoPlayerController.network(videoUrl); | |
| videoPlayerController.initialize().then((value) { | |
| notifyListeners(); | |
| }); | |
| } |
This file contains hidden or 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
| RichText( | |
| text: TextSpan(children: [ | |
| TextSpan(text: "Forgot "), | |
| TextSpan( | |
| text: "Password?", | |
| style: TextStyle( | |
| decoration: TextDecoration.underline, | |
| decorationThickness: 2, | |
| decorationStyle: TextDecorationStyle.wavy)) | |
| ], style: TextStyle(color: Colors.black))) |
This file contains hidden or 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
| Text( | |
| "Forgot Password?", | |
| style: TextStyle( | |
| shadows: [ | |
| Shadow( | |
| color: Colors.red, | |
| offset: Offset(0, -5)) | |
| ], | |
| color: Colors.transparent, | |
| decoration: |
This file contains hidden or 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
| Container( | |
| padding: EdgeInsets.only( | |
| bottom: 5, // Space between underline and text | |
| ), | |
| decoration: BoxDecoration( | |
| border: Border(bottom: BorderSide( | |
| color: Colors.amber, | |
| width: 1.0, // Underline thickness | |
| )) | |
| ), |
This file contains hidden or 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
| Text( | |
| "Forgot Password?", | |
| style: TextStyle( | |
| decoration: TextDecoration.underline, | |
| decorationColor: Colors.blue, | |
| decorationThickness: 4, | |
| decorationStyle: TextDecorationStyle.dashed, | |
| ), | |
| ) |
This file contains hidden or 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
| Text( | |
| "Forgot Password?", | |
| style: TextStyle( | |
| decoration: TextDecoration.underline, | |
| ), | |
| ) |