Skip to content

Resolve issue where 'subtitleOn' doesn't enable subtitles by default on iOS #917

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

Merged

Conversation

alideep5
Copy link

@alideep5 alideep5 commented Apr 8, 2025

This pull request includes a small change to the lib/src/cupertino/cupertino_controls.dart file. It updates the _initialize method to correctly assign the _subtitleOn flag based on chewieController.showSubtitles and whether the subtitle is not empty.

Previously, the code was:

chewieController.showSubtitles &&
    (chewieController.subtitle?.isNotEmpty ?? false);

This line had no effects and was effectively dead code. The condition was evaluated but not used.

The updated version assigns the result of the condition to _subtitleOn:

_subtitleOn = chewieController.showSubtitles &&
    (chewieController.subtitle?.isNotEmpty ?? false);

This change ensures that subtitles are properly enabled by default when the showSubtitles flag is true and a non-empty subtitle is present.

File Changes

@louisdeveseleer
Copy link

That should fix #914

Copy link
Collaborator

@diegotori diegotori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.55%. Comparing base (b0ccd83) to head (fbb60cb).
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #917      +/-   ##
==========================================
- Coverage   44.95%   44.55%   -0.41%     
==========================================
  Files          22       22              
  Lines        1546     1560      +14     
==========================================
  Hits          695      695              
- Misses        851      865      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@diegotori diegotori merged commit 1cf5881 into fluttercommunity:master Apr 17, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants