stateful_builder_controller

Creator: coderz1093

Last updated:

0 purchases

stateful_builder_controller Image
stateful_builder_controller Images

Languages

Categories

Add to Cart

Description:

stateful builder controller

stateful_builder_controller #


control setState for StatefulWidget locally
cache big value/widget for StatefulWidget

Example #
// 0. define property for widget
double headerHeight = 100;

// 1. create SetterController
final setterController = SetterController();

// 2. create StatefulWidget with headerHeight and setterController
@override
Widget build(BuildContext context) {
return StatefulBuilder1(
controller: setterController,
builder: (context, setter, value) {
return Container(
height: headerHeight,
color: Colors.red,
alignment: Alignment.center,
child: value,
);
},
value: Text("big widget"),
);
}

// 3. update headerHeight with setterController for reload StatefulBuilder1 only
setterController.update(() {
headerHeight = 200;
});
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.