CardSection constructor

const CardSection({
  1. Key? key,
  2. Widget? leading,
  3. String? thumbHash,
  4. Widget? trailing,
  5. double leadingThreshold = 300,
  6. double trailingThreshold = 350,
  7. Widget? title,
  8. Widget? subtitle,
  9. bool essentialLeading = false,
  10. bool essentialTrailing = true,
  11. VoidCallback? onPressed,
  12. IconData? leadingIcon,
  13. String? titleText,
  14. String? subtitleText,
  15. List<Widget> children = const [],
  16. bool dashedBorder = false,
})

Creates a CardSection with customizable header and content.

  • key: Standard Flutter key for widget identification.
  • leading: Optional leading widget (e.g., icon or image) shown on wider screens or when essential.
  • thumbHash: Optional thumbhash string for generating a blurred background image in the GlowCard.
  • trailing: Optional trailing widget (e.g., action button) shown on wider screens or when essential.
  • leadingThreshold: Screen width threshold (default 300) below which leading is hidden unless essential.
  • trailingThreshold: Screen width threshold (default 350) below which trailing is hidden unless essential.
  • title: Optional Widget for the section title, or use titleText for simple text.
  • subtitle: Optional Widget for the section subtitle, or use subtitleText for simple text.
  • essentialLeading: If true, forces leading to always show regardless of width.
  • essentialTrailing: If true (default), forces trailing to always show regardless of width.
  • onPressed: Optional callback for handling press events on the section.
  • leadingIcon: Optional IconData to display as a FancyIcon if no leading provided.
  • titleText: Simple string for title if no title widget provided; rendered as Text.
  • subtitleText: Simple string for subtitle if no subtitle widget provided; rendered as Text.
  • children: List of Widgets for the section body; separated by Divider if non-empty.
  • dashedBorder: If true, applies a dashed border style to the GlowCard.

Usage example: CardSection(title: Text('Details'), children: [BasicCard(...)]) for structured content in screens.

Implementation

const CardSection(
    {super.key,
    this.leading,
    this.thumbHash,
    this.trailing,
    this.leadingThreshold = 300,
    this.trailingThreshold = 350,
    this.title,
    this.subtitle,
    this.essentialLeading = false,
    this.essentialTrailing = true,
    this.onPressed,
    this.leadingIcon,
    this.titleText,
    this.subtitleText,
    this.children = const [],
    this.dashedBorder = false});