Skip to content

Commit

Permalink
build subtitle toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebar Ahmad committed May 24, 2021
1 parent 8a9014b commit 041e0e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/src/cupertino_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class _CupertinoControlsState extends State<CupertinoControls>

@override
Widget build(BuildContext context) {
_subtitleOn = chewieController.subtitle?.isNotEmpty ?? false;

if (_latestValue.hasError) {
return chewieController.errorBuilder != null
? chewieController.errorBuilder!(
Expand Down Expand Up @@ -546,6 +544,7 @@ class _CupertinoControlsState extends State<CupertinoControls>
}

Future<void> _initialize() async {
_subtitleOn = chewieController.subtitle?.isNotEmpty ?? false;
controller.addListener(_updateState);

_updateState();
Expand Down
4 changes: 2 additions & 2 deletions lib/src/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class _MaterialControlsState extends State<MaterialControls>

@override
Widget build(BuildContext context) {
_subtitleOn = chewieController.subtitle?.isNotEmpty ?? false;

if (_latestValue.hasError) {
return chewieController.errorBuilder?.call(
context,
Expand Down Expand Up @@ -173,6 +171,7 @@ class _MaterialControlsState extends State<MaterialControls>
const SizedBox()
else
_buildProgressBar(),
_buildSubtitleToggle(),
if (chewieController.allowPlaybackSpeedChanging)
_buildSpeedButton(controller),
if (chewieController.allowMuting) _buildMuteButton(controller),
Expand Down Expand Up @@ -389,6 +388,7 @@ class _MaterialControlsState extends State<MaterialControls>
}

Future<void> _initialize() async {
_subtitleOn = chewieController.subtitle?.isNotEmpty ?? false;
controller.addListener(_updateState);

_updateState();
Expand Down

0 comments on commit 041e0e2

Please sign in to comment.