GenericReactionListCore<A, Ob, T, Or> class
The generic version of ReactionListCore
ReactionListCore is a core class that allows fetching a list of reactions while exposing UI builders.
Usage
class ReactionListView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: ReactionListCore(
errorBuilder: (context, error) => Center(
child: Text('An error has occurred'),
),
emptyBuilder: (context) => Center(
child: Text('Nothing here...'),
),
loadingBuilder: (context) => Center(
child: CircularProgressIndicator(),
),
feedBuilder: (context, reactions) {
return Text('Your ListView/GridView of reactions');
}
),
);
}
}
Make sure to have a FeedProvider ancestor in order to provide the information about the reactions.
Usually what you want is the convenient ReactionListCore that already has the default parameters defined for you suitable to most use cases. But if you need a more advanced use case use GenericReactionListCore instead The generic parameters can be of the following type:
- A :
actor
can be an User, or a String - Ob :
object
can a String, or a CollectionEntry - T :
target
can be a String or an Activity - Or :
origin
can be a String or a Reaction or an User
To avoid potential runtime errors make sure they are the same across the app if you go the route of using Generic* classes
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GenericReactionListCore
- Implementers
Constructors
- GenericReactionListCore({Key? key, required ReactionsBuilder reactionsBuilder, required String lookupValue, required WidgetBuilder loadingBuilder, required WidgetBuilder emptyBuilder, required ErrorBuilder errorBuilder, LookupAttribute lookupAttr = LookupAttribute.activityId, Filter? filter, EnrichmentFlags? flags, String? kind, int? limit, ScrollPhysics? scrollPhysics})
-
ReactionListCore is a core class that allows fetching a list of
reactions while exposing UI builders.
const
Properties
- emptyBuilder → WidgetBuilder
-
Function used to build an empty widget
final
- errorBuilder → ErrorBuilder
-
Callback triggered when an error occurs while performing the given
request.
final
- filter → Filter?
-
Note: passing both id_lteandid_gte is not supported.
final
- flags → EnrichmentFlags?
-
Flags to indicate the API to enrich activities with additional info like
user reactions and count
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- kind → String?
-
The kind of reaction, usually i.e 'comment', 'like', 'reaction' etc
final
- limit → int?
-
The limit of activities to fetch
final
- loadingBuilder → WidgetBuilder
-
Function used to build a loading widget
final
- lookupAttr → LookupAttribute
-
final
- lookupValue → String
-
final
- reactionsBuilder → ReactionsBuilder
-
A builder that allows building a ListView of Reaction based Widgets
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollPhysics → ScrollPhysics?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _GenericReactionListCoreState< A, Ob, T, Or> -
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.
override
-
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