of static method

ChatColors of(
  1. BuildContext context
)

Look up the ChatColors from a BuildContext. Returns a const empty instance when the host hasn't wired one, so call sites never deal with null.

Implementation

static ChatColors of(BuildContext context) {
  return Theme.of(context).extension<ChatColors>() ?? const ChatColors();
}