showDescriptionHeader method

Widget showDescriptionHeader(
  1. String description, {
  2. String? title,
  3. Color descriptionValueColor = Colors.black,
})

Displays a description header in an elevated card.

Creates a full-width card containing a bold title and capitalized description text. Commonly used to display item descriptions or detailed information sections.

Parameters:

  • description: The description text to display (automatically capitalized).
  • title: Optional title text (defaults to "Description").
  • descriptionValueColor: Color for both title and description text (defaults to black).

Returns an elevated box containing the description content.

Example:

showDescriptionHeader(
  'this is a detailed product description',
  title: 'Product Details',
  descriptionValueColor: Colors.grey[800],
);

Implementation

Widget showDescriptionHeader(String description,
    {String? title, Color descriptionValueColor = Colors.black}) {
  return Utils.commonWidgets.getBoxWithElevation(
    child: Container(
      constraints: BoxConstraints(minWidth: Get.size.width),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            title ?? "Description",
            style: TextStyle(
              color: descriptionValueColor,
              fontWeight: FontWeight.bold,
            ),
          ),
          Text(GetUtils.capitalizeFirst(description)!),
        ],
      ),
    ),
  );
}