New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore layout for somes childs ? #17
Comments
You can't avoid calling layout on children, however, the framework does implement optimizations that short-circuit it for you. If the constraints passed to a child are the same as in the previous layout (and markNeedsLayout wasn't called) then the framework skips calling performLayout: see |
That is great to hear ! I definitely see an improvement (250 to 80 micro-seconds !) by having the same constraints object for all the children. However, it appears that, all the widgets still repaints, I already have a
I'm a bit lost here :
// The entire top widget
class Salut extends StatefulWidget {
const Salut({Key? key}) : super(key: key);
@override
State<Salut> createState() => _SalutState();
}
class _SalutState extends State<Salut> {
bool open = false;
@override
Widget build(BuildContext context) {
// Never printed outside the first frame
print('rebuild top');
return GestureDetector(
onTap: () {
BottomWaveViewState waveViewState = BottomWaveView.of(context);
open = !open;
waveViewState.toogleWave(open);
},
child: const SizedBox(
height: double.infinity,
width: double.infinity,
child: Placeholder(child: Center(child: Text('Has to resize'))),
));
}
} If you have some ideas, I would love to get your directions on this |
Hello, I was just wondering if is was possible to avoid a layout for some child ?
I have one child that need to be resized based on a animation value and currently everything is in the layout method.
Here is a small video to illustrate a bit :
https://user-images.githubusercontent.com/42180076/187019036-5fd2e168-72c0-4c8e-a875-1d65d26d23e1.mp4
Thank you !
The text was updated successfully, but these errors were encountered: