OneNotification<T> class

Rebuild the widget below OneNotification It can be usually used to rebuild widget tree Use: OneNotififier.notify(BuildContext, NotificationPayload

stopBubbling avoid to bubbling event and data to ancestor widgets (default = false) rebuildOnNull if set true, it will rebuild when payload is null (default = false), but it will use cached data instead rebuildOnData if set true, it will rebuild when payload has data (default = true) and data has the same type of generics

e.g.

OneNotification

If you dont use generic, it assume that is a dynamic type, and builder always is get dispatched if rebuildOnData = true(default = true) So, ever use a generic type to avoid unexpected behaviors.

Inheritance

Constructors

OneNotification({required NotificationBuilder<T?> builder, T? initialData, OnVisited? onVisited, bool stopBubbling = false, bool rebuildOnNull = false, bool rebuildOnData = true, List<Type>? types, Key? key})

Properties

builder NotificationBuilder<T?>
final
hashCode int
The hash code for this object.
no setterinherited
initialData → T?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onVisited OnVisited?
final
rebuildOnData bool
final
rebuildOnNull bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stopBubbling bool
final
types List<Type>?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _OneNotificationState<T>
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}) 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

Static Methods

hardReloadRoot(BuildContext context) → dynamic
Use it to reload the entire widget three, loose previous data of most top OneNotification found Cunrrently it recreate most top OneNotification
notify<T>(BuildContext context, {NotificationPayload<T>? payload}) → dynamic
Use it to reload a OneNotification widget children It use the type of NotificationPayload.data to decide if it has to make changes
softReloadRoot(BuildContext context) → dynamic
Cunrrently it rebuild most top OneNotification