PingoraSelector<T extends Pingora, S> class

The PingoraSelector widget is a highly optimized reactive builder that listens to a specific Pingora controller and rebuilds only when a selected portion of the state changes. This helps avoid unnecessary UI rebuilds and improves performance by isolating updates to only required state slices instead of rebuilding the entire widget tree.

Inheritance

Constructors

PingoraSelector({Key? key, required T listenable(BuildContext context), required S selector(T controller), required Widget builder(BuildContext context, S value)})
Creates a PingoraSelector widget that listens to a specific portion of a Pingora controller and rebuilds efficiently when the selected state changes based on the provided selector function logic.
const

Properties

builder Widget Function(BuildContext context, S value)
A builder function that constructs the UI based on the selected value. This function is only triggered when the selected state changes, which improves performance by preventing unnecessary rebuilds of unchanged UI.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listenable → T Function(BuildContext context)
A function that provides the instance of the Pingora controller from the current BuildContext. This allows the selector to access the correct scoped controller without relying on global instances.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selector → S Function(T controller)
A selector function that extracts a specific piece of state from the Pingora controller. Only the returned value is monitored for changes, ensuring that the widget rebuilds only when this selected state changes.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PingoraSelector<T, S>>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited