GenericFlatFeedCore<A, Ob, T, Or> class
GenericFlatFeedCore is a simplified class that allows fetching a list of enriched activities (flat) while exposing UI builders.
FlatFeedCore is a core class that allows fetching a list of enriched activities (flat) while exposing UI builders. Make sure to have a FeedProvider ancestor in order to provide the information about the activities. Usually what you want is the convenient FlatFeedCore that already has the default parameters defined for you suitable to most use cases. But if you need a more advanced use case use GenericFlatFeedCore instead
Usage
class ActivityListView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: FlatFeedCore(
errorBuilder: (context, error) => Center(
child: Text('An error has occurred'),
),
emptyBuilder: (context) => Center(
child: Text('Nothing here...'),
),
loadingBuilder: (context) => Center(
child: CircularProgressIndicator(),
),
feedBuilder: (context, activities) {
return Text('Your ListView/GridView of activities');
}
),
);
}
}
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
- GenericFlatFeedCore
- Implementers
Constructors
-
GenericFlatFeedCore({Key? key, required String feedGroup, required EnrichedFeedBuilder<
A, Ob, T, Or> feedBuilder, required WidgetBuilder loadingBuilder, required WidgetBuilder emptyBuilder, required ErrorBuilder errorBuilder, int? limit, int? offset, String? session, Filter? filter, EnrichmentFlags? flags, String? ranking, String? userId}) -
Create a new GenericFlatFeedCore.
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
-
feedBuilder
→ EnrichedFeedBuilder<
A, Ob, T, Or> -
A builder that provides a list of EnrichedActivities to display
final
- feedGroup → String
-
The feed group to use for the request
final
- filter → Filter?
-
The filter to use for the request
final
- flags → EnrichmentFlags?
-
The flags to use for the request
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- limit → int?
-
The limit of activities to fetch
final
- loadingBuilder → WidgetBuilder
-
Function used to build a loading widget
final
- offset → int?
-
The offset of activities to fetch
final
- ranking → String?
-
The ranking to use for the request
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- session → String?
-
The session to use for the request
final
- userId → String?
-
The user id to use for the request
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _GenericFlatFeedCoreState< 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