PlinthProfileCard class
A card about one person.
Centred it is a profile — avatar, name, a badge, the counts that go with a profile. Left-aligned it is a contact card — the same person with facts beside them instead of figures. Both are this widget, because they differ in alignment and in what fills the middle, not in what they are.
PlinthProfileCard(
initials: 'YL',
name: 'Yair Lahav',
badge: const PlinthBadge('Maintainer', color: 'grape'),
stats: const [
PlinthStat(value: '128', label: 'Posts'),
PlinthStat(value: '2.4k', label: 'Followers'),
],
actions: [PlinthButton(onPressed: follow, child: const Text('Follow'))],
)
The counts reuse PlinthStatStrip, which already merges each value with its label so "128 posts" is one thing to a screen reader rather than a number and a caption that happen to be stacked.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- PlinthProfileCard
Constructors
-
PlinthProfileCard({Key? key, required String name, String? detail, String? initials, Widget? avatar, Widget? badge, String? bio, List<
PlinthStat> stats = const [], List<PlinthDataListItem> details = const [], List<Widget> actions = const [], bool centered = true, PlinthSize avatarSize = PlinthSize.xl, int nameOrder = 4, double? width}) -
const
Properties
-
actions
→ List<
Widget> -
final
- avatar → Widget?
-
final
- avatarSize → PlinthSize
-
final
- badge → Widget?
-
Under the name, usually a PlinthBadge.
final
- bio → String?
-
A paragraph about them.
final
- centered → bool
-
Centres the avatar, name and badge. False puts the avatar beside
the name, which is the contact-card arrangement.
final
- detail → String?
-
A line under the name — a role, a location, a handle.
final
-
details
→ List<
PlinthDataListItem> -
Facts, rendered as a PlinthDataList — email, phone, timezone.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initials → String?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- name → String
-
final
- nameOrder → int
-
Heading level for name. A card about a person has a heading,
which is how a screen reader finds it among a page of them.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stats
→ List<
PlinthStat> -
Counts, rendered as a PlinthStatStrip.
final
- width → double?
-
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