fix: give token bars a height so their fills paint
A Row lays a childless ColoredBox out at zero height (the cross axis is loose), so the token segments in the model bars, the token-composition bar and the tool success bars painted nothing, while the single-ColoredBox steps/cost bars worked. Stretching those rows makes the fills visible; the stats test now asserts a token segment's height, not only its width.
This commit is contained in:
1 parent
2e0308f232
commit
bd8afeb686
2 files changed
+16
-8
No files matched your search
@@ -592,7 +592,10 @@ class _StatsScreenState extends State<StatsScreen> {
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
child: SizedBox(
|
||||
height: 10,
|
||||
// A Row lays a childless ColoredBox out at zero height unless
|
||||
// the cross axis is stretched; without this the bar is invisible.
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
for (final segment in segments)
|
||||
if (segment.value > 0)
|
||||
@@ -751,7 +754,9 @@ class _StatsScreenState extends State<StatsScreen> {
|
||||
widthFactor: visible,
|
||||
heightFactor: 1,
|
||||
child: _dimension == _ModelDimension.tokens
|
||||
? Row(children: [
|
||||
? Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
for (final (i, value) in [
|
||||
model.tokens.input,
|
||||
model.tokens.produced,
|
||||
@@ -866,6 +871,7 @@ class _StatsScreenState extends State<StatsScreen> {
|
||||
child: SizedBox(
|
||||
height: 5,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
if (tool.succeeded > 0)
|
||||
Expanded(
|
||||
|
||||
Reference in new issue
Block a user