TextStatusBadge constructor

const TextStatusBadge({
  1. Key? key,
  2. required String status,
  3. Color? backgroundColor,
  4. Color? color = const Color(0xFF000000),
  5. String? textColorKey,
  6. String? backgroundColorKey,
  7. Color? borderColor,
  8. String? borderColorKey,
})

Creates a TextStatusBadge widget.

Parameters:

  • status: The status text to display (required).
  • color: Explicit text color (optional, defaults to black).
  • textColorKey: Theme token key or hex string for text color (optional).
  • backgroundColorKey: Theme token key or hex string for background color (preferred).
  • backgroundColor: Explicit background color (deprecated, use backgroundColorKey instead).
  • borderColor: Explicit border color (optional).
  • borderColorKey: Theme token key or hex string for border color (optional).

Note: Color resolution priority:

  1. Explicit color values (color, backgroundColor, borderColor)
  2. Theme token keys or hex strings (textColorKey, backgroundColorKey, borderColorKey)
  3. Default theme tokens ('default' group) if no keys provided
  4. Automatic text color calculation based on background luminance

Implementation

const TextStatusBadge({
  super.key,
  required this.status,
  // @Deprecated(
  //     'Use backgroundColorKey or theme tokens; this prop will be removed in a future release.')
  this.backgroundColor, // Default background color
  this.color = const Color(0xFF000000), // Default text color
  this.textColorKey,
  this.backgroundColorKey,
  this.borderColor,
  this.borderColorKey,
});