VCard class
A flexible container component that displays content with an optional title, subtitle, and child widget. Cards are commonly used to group related information and actions.
Example:
VCard(
image: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/avatar.png'),
fit: BoxFit.cover,
),
),
height: 200,
),
title: const Text('Gratitude'),
subtitle: const Text(
'The quality of being thankful; readiness to show appreciation for and to return kindness.',
),
content: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
VTextField(label: 'Name'),
SizedBox(height: 10),
VTextField(label: 'Email'),
],
),
footer: Row(
children: [
Expanded(
child: VButton(
onPress: () {},
child: const Text('Cancel'),
),
),
SizedBox(width: 10),
Expanded(
child: VButton(
onPress: () {},
child: const Text('Submit'),
),
),
],
),
contentPadding: 16,
)
- Inheritance
Constructors
- VCard({Key? key, Widget? image, Widget? title, Widget? subtitle, Widget? content, MainAxisSize mainAxisSize = MainAxisSize.min, Clip clipBehavior = Clip.none, EdgeInsets contentPadding = const EdgeInsets.all(16)})
-
const
Properties
- cardChild → Widget?
-
Builds the child widget for the card, which includes the content and footer,
no setter
- clipBehavior → Clip
-
How to clip the card's content.
Defaults to Clip.none.
final
- content → Widget?
-
An optional content widget displayed in the card body.
final
- contentPadding → EdgeInsets
-
Content padding inside the card. Defaults to 16 pixels on all sides.
Note: If content is null, this padding will not be applied.
final
-
An optional footer widget displayed at the bottom of the card.
Separated from content by a divider.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- image → Widget?
-
An optional image widget displayed at the top of the card.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mainAxisSize → MainAxisSize
-
Determines how the card's main axis should be sized.
Defaults to MainAxisSize.min.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- styleDelta → FCardStyleDelta
-
no setter
- subtitle → Widget?
-
An optional subtitle widget displayed below the title.
final
- title → Widget?
-
An optional title widget displayed below the image.
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