I have a widget A
that I want to scale (pixel perfect). Depending on display width of the device, the size of A
should be either increased or decreased. I tried the Transform.scale
widget to change the size of the A
. This works well but the size of the Transform.scale
widget never changes. It always matches the original size of A
(without scaling).
Is there any way to force Transform.scale
that it always adopts the size of its child? Or is there an alternative approach?
You can find an image here that shows the current and the required situation
EDIT:
Widget A
and its children should shrink/grow uniformly. The ratios between them should not change.
Here is the code I currently tried
_buildWidgetA(scalingFactor) {
return Transform.scale(
scale: scalingFactor,
child: A(),
);
}