Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 41 additions & 32 deletions lib/src/material/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,19 @@ class _MaterialControlsState extends State<MaterialControls>
controller.setVolume(0.0);
}
},
child: AnimatedOpacity(
opacity: notifier.hideStuff ? 0.0 : 1.0,
duration: const Duration(milliseconds: 300),
child: ClipRect(
child: Container(
height: barHeight,
padding: const EdgeInsets.only(left: 6.0),
child: Icon(
_latestValue.volume > 0 ? Icons.volume_up : Icons.volume_off,
color: Colors.white,
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: AnimatedOpacity(
opacity: notifier.hideStuff ? 0.0 : 1.0,
duration: const Duration(milliseconds: 300),
child: ClipRect(
child: Container(
height: barHeight,
padding: const EdgeInsets.only(left: 6.0),
child: Icon(
_latestValue.volume > 0 ? Icons.volume_up : Icons.volume_off,
color: Colors.white,
),
),
),
),
Expand All @@ -324,19 +327,22 @@ class _MaterialControlsState extends State<MaterialControls>
GestureDetector _buildExpandButton() {
return GestureDetector(
onTap: _onExpandCollapse,
child: AnimatedOpacity(
opacity: notifier.hideStuff ? 0.0 : 1.0,
duration: const Duration(milliseconds: 300),
child: Container(
height: barHeight + (chewieController.isFullScreen ? 15.0 : 0),
margin: const EdgeInsets.only(right: 12.0),
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Center(
child: Icon(
chewieController.isFullScreen
? Icons.fullscreen_exit
: Icons.fullscreen,
color: Colors.white,
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: AnimatedOpacity(
opacity: notifier.hideStuff ? 0.0 : 1.0,
duration: const Duration(milliseconds: 300),
child: Container(
height: barHeight + (chewieController.isFullScreen ? 15.0 : 0),
margin: const EdgeInsets.only(right: 12.0),
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Center(
child: Icon(
chewieController.isFullScreen
? Icons.fullscreen_exit
: Icons.fullscreen,
color: Colors.white,
),
),
),
),
Expand Down Expand Up @@ -473,15 +479,18 @@ class _MaterialControlsState extends State<MaterialControls>
}
return GestureDetector(
onTap: _onSubtitleTap,
child: Container(
height: barHeight,
color: Colors.transparent,
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Icon(
_subtitleOn
? Icons.closed_caption
: Icons.closed_caption_off_outlined,
color: _subtitleOn ? Colors.white : Colors.grey[700],
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: Container(
height: barHeight,
color: Colors.transparent,
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Icon(
_subtitleOn
? Icons.closed_caption
: Icons.closed_caption_off_outlined,
color: _subtitleOn ? Colors.white : Colors.grey[700],
),
),
),
);
Expand Down
71 changes: 40 additions & 31 deletions lib/src/material/material_desktop_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,19 +314,22 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
GestureDetector _buildExpandButton() {
return GestureDetector(
onTap: _onExpandCollapse,
child: AnimatedOpacity(
opacity: notifier.hideStuff ? 0.0 : 1.0,
duration: const Duration(milliseconds: 300),
child: Container(
height: barHeight + (chewieController.isFullScreen ? 15.0 : 0),
margin: const EdgeInsets.only(right: 12.0),
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Center(
child: Icon(
chewieController.isFullScreen
? Icons.fullscreen_exit
: Icons.fullscreen,
color: Colors.white,
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: AnimatedOpacity(
opacity: notifier.hideStuff ? 0.0 : 1.0,
duration: const Duration(milliseconds: 300),
child: Container(
height: barHeight + (chewieController.isFullScreen ? 15.0 : 0),
margin: const EdgeInsets.only(right: 12.0),
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Center(
child: Icon(
chewieController.isFullScreen
? Icons.fullscreen_exit
: Icons.fullscreen,
color: Colors.white,
),
),
),
),
Expand Down Expand Up @@ -409,16 +412,19 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
controller.setVolume(0.0);
}
},
child: AnimatedOpacity(
opacity: notifier.hideStuff ? 0.0 : 1.0,
duration: const Duration(milliseconds: 300),
child: ClipRect(
child: Container(
height: barHeight,
padding: const EdgeInsets.only(right: 15.0),
child: Icon(
_latestValue.volume > 0 ? Icons.volume_up : Icons.volume_off,
color: Colors.white,
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: AnimatedOpacity(
opacity: notifier.hideStuff ? 0.0 : 1.0,
duration: const Duration(milliseconds: 300),
child: ClipRect(
child: Container(
height: barHeight,
padding: const EdgeInsets.only(right: 15.0),
child: Icon(
_latestValue.volume > 0 ? Icons.volume_up : Icons.volume_off,
color: Colors.white,
),
),
),
),
Expand All @@ -429,14 +435,17 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
GestureDetector _buildPlayPause(VideoPlayerController controller) {
return GestureDetector(
onTap: _playPause,
child: Container(
height: barHeight,
color: Colors.transparent,
margin: const EdgeInsets.only(left: 8.0, right: 4.0),
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: AnimatedPlayPause(
playing: controller.value.isPlaying,
color: Colors.white,
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: Container(
height: barHeight,
color: Colors.transparent,
margin: const EdgeInsets.only(left: 8.0, right: 4.0),
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: AnimatedPlayPause(
playing: controller.value.isPlaying,
color: Colors.white,
),
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class _VideoProgressBarState extends State<VideoProgressBar> {
}
_seekToRelativePosition(details.globalPosition);
},
child: child,
child: MouseRegion(cursor: SystemMouseCursors.click, child: child),
)
: child;
}
Expand Down