MiniCardOptions class
Configuration options for the MiniCard widget.
Provides properties to customize the appearance of a small participant avatar/badge, displaying either an image or text initials with extensive styling options.
Core Display Properties:
initials: Text fallback when no image provided (e.g., "JD" for "John Doe")fontSize: Text size for initials (default: 14)imageSource: Optional network image URL; if null/empty, displays initialsroundedImage: If true, applies circular clipping (borderRadius=9999); default=true
Container Styling:
customStyle: BoxDecoration for outer container (background, border, etc.)padding/margin/alignment: Positioning and spacing for outer container
Initials Styling:
initialsDecoration: BoxDecoration for initials wrapper (background color, etc.)initialsPadding: Padding around initials textinitialsTextStyle: TextStyle override (font, color, weight); default=black/600
Image Styling:
imageStyle: BoxDecoration for image wrapper (border radius extracted for ClipRRect)imageContainerDecoration: BoxDecoration for image wrapper containerimageContainerPadding/imageContainerMargin: Spacing for image wrapperimageFit: How image fills bounds (default: BoxFit.cover)imageAlignment: Image alignment within bounds (default: Alignment.center)
Builder Hooks (3):
customBuilder: Full widget replacement; receives MiniCardOptionscontainerBuilder: Override outer Container; receives MiniCardContainerContext + defaultimageBuilder: Override image display; receives MiniCardImageContext + defaultinitialsBuilder: Override initials display; receives MiniCardInitialsContext + default
Usage Patterns:
-
Default Initials Display:
MiniCard( options: MiniCardOptions( initials: 'JD', customStyle: BoxDecoration(color: Colors.blue, shape: BoxShape.circle), ), ) -
Image Avatar:
MiniCard( options: MiniCardOptions( initials: 'JD', imageSource: 'https://example.com/avatar.jpg', roundedImage: true, ), ) -
Custom Builder Hook:
MiniCard( options: MiniCardOptions( initials: 'JD', containerBuilder: (context, defaultContainer) { return GestureDetector( onTap: () => print('Avatar tapped'), child: defaultContainer, ); }, ), )
Override Integration:
Can be overridden via MediasfuUICustomOverrides using ComponentOverride<MiniCardOptions>:
overrides: MediasfuUICustomOverrides(
miniCardOptions: ComponentOverride<MiniCardOptions>(
builder: (existingOptions) => MiniCardOptions(
initials: existingOptions.initials,
imageSource: existingOptions.imageSource,
customStyle: BoxDecoration(border: Border.all(color: Colors.gold, width: 2)),
),
),
),
Implementation Notes:
- Image loading failures automatically fallback to initials display
- Border radius extraction from imageStyle.borderRadius for ClipRRect compatibility
- Builder hooks receive both context and default widget for wrapping patterns
Constructors
-
MiniCardOptions({required String initials, double fontSize = 14, BoxDecoration customStyle = const BoxDecoration(), String? imageSource, bool roundedImage = true, BoxDecoration? imageStyle, MiniCardType? customBuilder, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, AlignmentGeometry? alignment, BoxDecoration? initialsDecoration, EdgeInsetsGeometry? initialsPadding, TextStyle? initialsTextStyle, BoxDecoration? imageContainerDecoration, EdgeInsetsGeometry? imageContainerPadding, EdgeInsetsGeometry? imageContainerMargin, BoxFit imageFit = BoxFit.cover, AlignmentGeometry imageAlignment = Alignment.center, MiniCardContainerBuilder? containerBuilder, MiniCardImageBuilder? imageBuilder, MiniCardInitialsBuilder? initialsBuilder, double size = 40.0, bool enableGlassmorphism = false, bool showGradientBackground = false, Gradient? gradient, bool isDarkMode = false, bool showBorder = false, Color? borderColor, double borderWidth = 1.0, bool showShadow = false, List<
BoxShadow> ? customShadow, Color? initialsBackgroundColor, bool enableGlow = false, Color? glowColor, double glowIntensity = 0.5, bool enablePremiumBorder = false}) -
const
Properties
- alignment → AlignmentGeometry?
-
final
- borderColor → Color?
-
Border color.
Used by modern styling.
final
- borderWidth → double
-
Border width.
Used by modern styling.
final
- containerBuilder → MiniCardContainerBuilder?
-
final
- customBuilder → MiniCardType?
-
final
-
customShadow
→ List<
BoxShadow> ? -
Custom shadow.
Used by modern styling.
final
- customStyle → BoxDecoration
-
final
- enableGlassmorphism → bool
-
Enable glassmorphism effects.
Used by modern styling for blur effects.
final
- enableGlow → bool
-
Enable glow effect.
Used by modern premium styling.
final
- enablePremiumBorder → bool
-
Enable premium border styling.
Used by modern premium styling.
final
- fontSize → double
-
final
- glowColor → Color?
-
Glow color.
Used by modern premium styling.
final
- glowIntensity → double
-
Glow intensity.
Used by modern premium styling.
final
- gradient → Gradient?
-
Optional gradient.
Used by modern styling.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageAlignment → AlignmentGeometry
-
final
- imageBuilder → MiniCardImageBuilder?
-
final
- imageContainerDecoration → BoxDecoration?
-
final
- imageContainerMargin → EdgeInsetsGeometry?
-
final
- imageContainerPadding → EdgeInsetsGeometry?
-
final
- imageFit → BoxFit
-
final
- imageSource → String?
-
final
- imageStyle → BoxDecoration?
-
final
- initials → String
-
final
- initialsBackgroundColor → Color?
-
Initials background color.
Used by modern styling.
final
- initialsBuilder → MiniCardInitialsBuilder?
-
final
- initialsDecoration → BoxDecoration?
-
final
- initialsPadding → EdgeInsetsGeometry?
-
final
- initialsTextStyle → TextStyle?
-
final
- isDarkMode → bool
-
Dark mode toggle.
Used by modern styling for theme.
final
- margin → EdgeInsetsGeometry?
-
final
- padding → EdgeInsetsGeometry?
-
final
- roundedImage → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showBorder → bool
-
Show border.
Used by modern styling.
final
- showGradientBackground → bool
-
Show gradient background.
Used by modern styling.
final
- showShadow → bool
-
Show shadow.
Used by modern styling.
final
- size → double
-
Size of the mini card.
Used by modern styling.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited