Does Flutter render un-seenable content?
I have two containers each containing their own stateful widgets, overlapping each other in a stack.
Both stateful widgets in the containers may be updated async anytime.
Container( height: double.infinity, width: double.infinity, child: Stack( children: [ Container( height: double.infinity, width: double.infinity, color: Colors.red, child: <some stateful widget 1>, ), //container 1 Container( height: double.infinity, width: double.infinity, color: Colors.green, child: <some stateful widget 2>, ), //container 2 ), ), );
I want to use an animation controller to control the opacities of container 1 and container 2 such that container 1 fades out (opacity from 1.0 to 0.0) and container 2 then fades in (opacity from 0.0 to 1.0).
I have 2 questions:
I would like to confirm if that there is none, or negligible rendering cost if setState is called for container 2 while container 2 opacity is 0
Supposing that container 1 and container 2 overlaps fully, container 1 on top and container 2 bottom, will setState cause unnecessary rendering of container 2 when it's called?