Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide options without play stop button #830

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
34 changes: 19 additions & 15 deletions lib/src/material/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ import 'package:video_player/video_player.dart';
class MaterialControls extends StatefulWidget {
const MaterialControls({
this.showPlayButton = true,
this.hideControlsWithoutPlayButton = false,
super.key,
});

final bool showPlayButton;
final bool hideControlsWithoutPlayButton;

@override
State<StatefulWidget> createState() {
Expand Down Expand Up @@ -90,22 +92,24 @@ class _MaterialControlsState extends State<MaterialControls>
)
else
_buildHitArea(),
_buildActionBar(),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
if (_subtitleOn)
Transform.translate(
offset: Offset(
0.0,
notifier.hideStuff ? barHeight * 0.8 : 0.0,
),
child:
if (widget.hideControlsWithoutPlayButton == false) ...[
_buildActionBar(),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
if (_subtitleOn)
Transform.translate(
offset: Offset(
0.0,
notifier.hideStuff ? barHeight * 0.8 : 0.0,
),
child:
_buildSubtitles(context, chewieController.subtitle!),
),
_buildBottomBar(context),
],
),
),
_buildBottomBar(context),
],
),
],
],
),
),
Expand Down