FlatFeedCore class

A simplified class that allows fetching a list of enriched activities (flat) while exposing UI builders.

FlatFeedCore extends GenericFlatFeedCore with default types of:

Under most circumstances FlatFeedCore is all you need to use.

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');
        }
      ),
    );
  }
}
Inheritance

Constructors

FlatFeedCore({Key? key, required EnrichedFeedBuilder<User, String, String, String> feedBuilder, required WidgetBuilder loadingBuilder, required WidgetBuilder emptyBuilder, required ErrorBuilder errorBuilder, int? limit, int? offset, String? session, Filter? filter, EnrichmentFlags? flags, String? ranking, String? userId, required String feedGroup})
Instantiates a new FlatFeedCore.
const

Properties

emptyBuilder WidgetBuilder
Function used to build an empty widget
finalinherited
errorBuilder → ErrorBuilder
Callback triggered when an error occurs while performing the given request.
finalinherited
feedBuilder → EnrichedFeedBuilder<User, String, String, String>
A builder that provides a list of EnrichedActivities to display
finalinherited
feedGroup String
The feed group to use for the request
finalinherited
filter Filter?
The filter to use for the request
finalinherited
flags EnrichmentFlags?
The flags to use for the request
finalinherited
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
finalinherited
loadingBuilder WidgetBuilder
Function used to build a loading widget
finalinherited
offset int?
The offset of activities to fetch
finalinherited
ranking String?
The ranking to use for the request
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
session String?
The session to use for the request
finalinherited
userId String?
The user id to use for the request
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _GenericFlatFeedCoreState<User, String, String, String>
Creates the mutable state for this widget at a given location in the tree.
inherited
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