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

Issue1045 - Wrapped duration widgets' Text widgets in a stack and added transparent Texts representing largest possible time string - DC #1046

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ChopinDavid
Copy link

This would close #1045

It is worth noting that this will have some merge conflicts with #1044, should that PR be merged.
If #1044 does end up being merged, we would want to _CurrentPositionState's and _RemainingDurationState's build methods to look like

@override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Text(
          "${_controller.value.position.inHours != 0 ? '00:' : ''}00:00",
          key: const Key('hidden-current-position-text'),
          style: const TextStyle(
            color: Colors.transparent,
            fontSize: 12.0,
            height: 1.0,
          ),
        ),
        Text(
          durationFormatter(
            _controller.value.position.inMilliseconds,
          ),
          style: const TextStyle(
            color: Colors.white,
            fontSize: 12.0,
            height: 1.0,
          ),
        ),
      ],
    );
  }

and

@override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Text(
          "- ${_controller.value.position.inHours != 0 ? '00:' : ''}00:00",
          key: const Key('hidden-remaining-duration-text'),
          style: const TextStyle(
            color: Colors.transparent,
            fontSize: 12.0,
            height: 1.0,
          ),
        ),
        Text(
          "- ${durationFormatter(
            (_controller.metadata.duration.inMilliseconds) -
                (_controller.value.position.inMilliseconds),
          )}",
          style: const TextStyle(
            color: Colors.white,
            fontSize: 12.0,
            height: 1.0,
          ),
        ),
      ],
    );
  }

, respectively.

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.

[FEATURE REQUEST] Give CurrentPosition and RemainingDuration fixed widths.
1 participant