getLogKindColor static method

Color getLogKindColor(
  1. BuildContext context,
  2. NetLensLogInfo info
)

Returns color of a log entry detected as info.

Implementation

static Color getLogKindColor(BuildContext context, NetLensLogInfo info) {
  final bool isDark = Theme.of(context).brightness == Brightness.dark;
  return switch (info.kind) {
    NetLensLogKind.request =>
      isDark ? const Color(0xff64b5f6) : const Color(0xff1565c0),
    NetLensLogKind.response => getStatusColor(context, info.status ?? 200),
    NetLensLogKind.error => isDark ? red : darkRed,
    NetLensLogKind.warning => isDark ? orange : darkOrange,
    NetLensLogKind.info => Theme.of(context).colorScheme.onSurfaceVariant,
  };
}