SetBadgeTextColorDetails constructor

SetBadgeTextColorDetails({
  1. required Object color,
  2. int? tabId,
})

Implementation

SetBadgeTextColorDetails({
  /// An array of four integers in the range [0,255] that make up the RGBA
  /// color of the badge. For example, opaque red is `[255, 0, 0, 255]`. Can
  /// also be a string with a CSS value, with opaque red being `#FF0000` or
  /// `#F00`. Not setting this value will cause a color to be automatically
  /// chosen that will contrast with the badge's background color so the text
  /// will be visible. Colors with alpha values equivalent to 0 will not be
  /// set and will return an error.
  required Object color,

  /// Limits the change to when a particular tab is selected. Automatically
  /// resets when the tab is closed.
  int? tabId,
}) : _wrapped = $js.SetBadgeTextColorDetails(
        color: switch (color) {
          String() => color.jsify()!,
          List<int>() => color.toJSArray((e) => e),
          _ => throw UnsupportedError(
              'Received type: ${color.runtimeType}. Supported types are: String, List<int>')
        },
        tabId: tabId,
      );