flutter_percent_indicator icon indicating copy to clipboard operation
flutter_percent_indicator copied to clipboard

Size issue

Open oscarshaitan opened this issue 1 year ago • 6 comments

in teh version 4.2.3 the followign code was working

LinearPercentIndicator(
                    width: 100,
                    percent: activitySummaryModel.percentageComplete / 100,
                    lineHeight: 20,
                    barRadius: const Radius.circular(6),
                    progressColor: symterraPrimaryCTABlue,
                    center: Text(
                      '${activitySummaryModel.percentageComplete}%',
                      style: const TextStyle(color: Colors.white),
                    ),
                    backgroundColor: darkGrey,
                  )

in the 4.2.4 I have to wrap the widget with a size box, I looked back in the commits this is the only one that change the builder

https://github.com/diegoveloper/flutter_percent_indicator/commit/522b5e9911bc6babafc11d10142de0f62e7bc911

The error Im getting is LayoutBuilder does not support returning intrinsic dimensions.

SizedBox(
                  height: 20, width: 100,
                  child: ```
LinearPercentIndicator(
                    width: 100,
                    percent: activitySummaryModel.percentageComplete / 100,
                    lineHeight: 20,
                    barRadius: const Radius.circular(6),
                    progressColor: symterraPrimaryCTABlue,
                    center: Text(
                      '${activitySummaryModel.percentageComplete}%',
                      style: const TextStyle(color: Colors.white),
                    ),
                    backgroundColor: darkGrey,
                  ),
                )

Ill take a deep look if I spot the reason. in any case. Gracias!

oscarshaitan avatar Nov 26 '24 16:11 oscarshaitan

thanks, it would be great if you could add a sample code to reproduce the issue.

diegoveloper avatar Nov 26 '24 16:11 diegoveloper

is quite difficult to extract since is inside a complex set of views. this is with the 4.2.3 fixed image

oscarshaitan avatar Nov 26 '24 17:11 oscarshaitan

could be a combination on my widgets that triggers that I isolate the card widget (just the white part) and looks is working. ill work with the previous version for now. ( I need to deploy ) then Ill give more time to search the cause

oscarshaitan avatar Nov 26 '24 17:11 oscarshaitan

Not sure I know what code to provide to reproduce the issue but I'm also reproducing it, in my case the LinearPercentIndicator is neseted inside a deep tree of row/colunn widgets, including a ListView above...

The issue was introduced by version 4.2.4, version 4.2.3 was working fine.

orevial avatar Dec 11 '24 17:12 orevial

is exactly my case is super deep in the tree. Dialog-> List>Card->row>Column>Row at minimum every isolation of the linear works, only when is that deep is when we have the issue

oscarshaitan avatar Dec 12 '24 09:12 oscarshaitan

having the issue if nested in Row => Expanded => Column => LinearPercentIndicator. Wrapping it with LayoutBuilder and setting width: constraints.maxWidth doesn't help

DevTello avatar Apr 14 '25 15:04 DevTello