fix more than needed rebuilds on canvas children
this used a stupid builderFunc instead of a widget so flutter wasn't able to optimise those widget builds and it was simply a blanket rebuild. Added more examples as well
This commit is contained in:
@@ -19,7 +19,7 @@ class _AppState extends State<App> {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
controller.addChild(
|
||||
Offset((i % 80) * 100.0, (i ~/ 80) * 100.0),
|
||||
(_) => GestureDetector(
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Tapped a container')));
|
||||
controller.focusOnChild(context, i);
|
||||
|
||||
Reference in New Issue
Block a user