InstaLikeButton class

Instagram post style, customizable card widget made for flutter.

Default Usage: (provided just required parameters).

InstaLikeButton(
 image: AssetImage("example/overview/img.jpg"),
 onChanged: () {},
);

Other properties which helps to customize InstaLikeButton.

  • duration, curve.
  • icon, iconColor, iconSize.
  • height, width.
  • onImageError, imageColorFilter, imageBoxfit, imageAlignment, imageScale.

Inheritance

Constructors

InstaLikeButton({required ImageProvider<Object>? image, required VoidCallback onChanged, IconData icon = Icons.favorite, Color? iconColor = const Color(0xFFF5F5F5), double? height = 300, double? width, Duration? duration = const Duration(milliseconds: 500), Curve curve = Curves.easeInOut, double iconSize = 120, dynamic onImageError(Object, StackTrace?)?, ColorFilter? imageColorFilter, BoxFit? imageBoxfit, AlignmentGeometry imageAlignment = Alignment.center, double imageScale = 1.0})

Properties

curve Curve
Curve of like animation. As default it equals Curves.easeInOut. If user wanna customize it, then should use it.
final
duration Duration?
Animation duration. As default it equals Duration(milliseconds: 500). If user wanna customize it, then should use it.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Height of InstaLikeButton.
final
icon IconData
The icon which would be displayed onto image in center. as default icon is Icons.favorite. If user wanna customize it, then should use it.
final
iconColor Color?
The icon's color. as default it equals Colors.grey[200]. If user wanna customize it, then should use it.
final
iconSize double
size of icon. As default it equals 120 If user wanna customize it, then should use it.
final
image ImageProvider<Object>?
This property takes a photo, and builds the entire button on that photo.
final
imageAlignment AlignmentGeometry
How to align the image within its bounds. The alignment aligns the given position in the image to the given position in the layout bounds.
final
imageBoxfit BoxFit?
How the image should be inscribed into the box.
final
imageColorFilter ColorFilter?
A color filter to apply to the image before painting it.
final
imageScale double
Defines image pixels to be shown per logical pixels.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged VoidCallback
The user has tapped the screen with a primary button at the same location twice in quick succession.
final
onImageError → (dynamic Function(Object, StackTrace?)?)
An optional error callback for errors emitted when loading image.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double?
width of InstaLikeButton.
final

Methods

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