FlutterFeedReaction class

The FlutterFeedReaction widget displays reactions list.

The reactions parameter must not be null. The prefix parameter must not be null. The onReactionSelected parameter must not be null. The onPressed parameter must not be null. The dragSpace parameter must not be null

This example shows the basic implementation of FlutterFeedReaction widget.

FlutterFeedReaction(
  reactions: [
    FeedReaction(
      name: "Like",
      reaction: Container(
        color: Colors.blue,
        width: 30.0,
        height: 30.0,
      ),
    ),
    FeedReaction(
      name: "Care",
      reaction: Container(
        color: Colors.deepOrange,
        width: 30.0,
        height: 30.0,
      ),
    ),
  ],
  dragSpace: 40.0,
  onReactionSelected: (val) {
    print(val.name);
  },
  onPressed: () {
    print("Pressed");
  },
  prefix: Image.asset(
    'assets/emojies/like_icon.png',
    width: 40.0,
    height: 40.0,
  ),
  suffix: Text("Like"),
  containerWidth: 200.0,
)
Inheritance

Constructors

FlutterFeedReaction({required List<FeedReaction> reactions, required Widget prefix, required dynamic onReactionSelected(FeedReaction), required double dragSpace, required dynamic onPressed(), double dragStart = 40.0, Widget? suffix, double spacing = 10.0, double containerWidth = 300.0, Alignment childAnchor = Alignment.topLeft, Alignment portalAnchor = Alignment.bottomLeft, BoxDecoration? containerDecoration})

Properties

childAnchor Alignment
The childAnchor and portalAnchor are the alignments of the reactions list around prefix and suffix widgets.
final
containerDecoration BoxDecoration?
The decoration of the reactions list container.
final
containerWidth double
The width of the reactions list container.
final
dragSpace double
The spacing between each drag.
final
dragStart double
The starting position of the drag.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPressed → dynamic Function()
The function that gets called when the prefix or widget is pressed.
final
onReactionSelected → dynamic Function(FeedReaction)
The function that gets called when a reaction is selected.
final
portalAnchor Alignment
The childAnchor and portalAnchor are the alignments of the reactions list around prefix and suffix widgets.
final
prefix Widget
The button to be pressed to show the reactions list.
final
reactions List<FeedReaction>
The reactions list to display when long pressed on the prefix or suffix widget.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spacing double
The spacing between the reactions list container and prefix/suffix widget.
final
suffix Widget?
The optional widget next to prefix widget.
final

Methods

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