KinGradientCard class
A rich card with gradient background, center icon, category chip, title, subtitle row with rating and favorite button.
Inspired by iOS travel/discovery card designs.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- KinGradientCard
Constructors
-
KinGradientCard({Key? key, required String title, required List<
Color> gradient, String? subtitle, String? category, IconData? categoryIcon, IconData? centerIcon, double? rating, String? reviews, bool showFavorite = true, bool isFavorite = false, VoidCallback? onFavoriteTap, VoidCallback? onTap, double borderRadius = 28, bool compact = false}) -
const
Properties
- borderRadius → double
-
Corner radius of the card.
final
- category → String?
-
Category label shown in a chip.
final
- categoryIcon → IconData?
-
Icon displayed inside the category chip.
final
- centerIcon → IconData?
-
Large subtle icon displayed in the center of the card.
final
- compact → bool
-
Use smaller text sizes for compact layouts.
final
-
gradient
→ List<
Color> -
Gradient colors from top-left to bottom-right.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFavorite → bool
-
Whether the card is in favorite state.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onFavoriteTap → VoidCallback?
-
Called when the favorite button is tapped.
final
- onTap → VoidCallback?
-
Called when the card is tapped.
final
- rating → double?
-
Rating value (e.g. 4.8).
final
- reviews → String?
-
Review count text (e.g. '7.2k').
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showFavorite → bool
-
Whether to show the favorite heart button.
final
- subtitle → String?
-
Subtitle text (e.g. location).
final
- title → String
-
The main title displayed prominently at the bottom.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's 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, int wrapWidth = 65}) → 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