I'm building a chat app where audio messages can accompany the text. The widget that displays this is a very standard looking chat bubble (think iMessage) with one twist - the bubble becomes a progress bar when the audio is playing. The progress bar is essentially just a gradual change in the background color. You can see the layout in this dartpad (hit run). A screenshot of the mock is here:
Because the chat bubble is rounded, I need the progress bar to round only at the end. In other words, it should always be rounded on the left as it is flush with the left side of the message but it should be flat on the right until it hits the end of the message. I think ClipRRect is the right widget to do this.
However, because the message bubble width is variable, I use a FractionallySizedBox as the progress bar. 1/10th the way through the audio, it should be 1/10th the width of the chat bubble. Then I use Positioned.fill to wrap the progress bar so that the fraction is taken out of the full message bubble width. ClipRRect does not seem to play nicely wrapping Positioned.fill I believe it expects the child to have a set size:
RenderBox was not laid out: RenderClipRRect#3b019 relayoutBoundary=up13
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1694 pos 12: 'hasSize'
This is a dartpad to the version with the not-working ClipRRect. Is there some other widget I can wrap Position.fill in to make it clippable? Or maybe a better way to lay this out?

