Skip to content

Commit ed24af4

Browse files
committed
Added const to AnsiColor constructors
1 parent 6c9f1ba commit ed24af4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

lib/src/ansi_color.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ class AnsiColor {
1010
final int? bg;
1111
final bool color;
1212

13-
AnsiColor.none()
13+
const AnsiColor.none()
1414
: fg = null,
1515
bg = null,
1616
color = false;
1717

18-
AnsiColor.fg(this.fg)
18+
const AnsiColor.fg(this.fg)
1919
: bg = null,
2020
color = true;
2121

22-
AnsiColor.bg(this.bg)
22+
const AnsiColor.bg(this.bg)
2323
: fg = null,
2424
color = true;
2525

lib/src/printers/pretty_printer.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class PrettyPrinter extends LogPrinter {
2727

2828
static final levelColors = {
2929
Level.verbose: AnsiColor.fg(AnsiColor.grey(0.5)),
30-
Level.debug: AnsiColor.none(),
31-
Level.info: AnsiColor.fg(12),
32-
Level.warning: AnsiColor.fg(208),
33-
Level.error: AnsiColor.fg(196),
34-
Level.wtf: AnsiColor.fg(199),
30+
Level.debug: const AnsiColor.none(),
31+
Level.info: const AnsiColor.fg(12),
32+
Level.warning: const AnsiColor.fg(208),
33+
Level.error: const AnsiColor.fg(196),
34+
Level.wtf: const AnsiColor.fg(199),
3535
};
3636

3737
static final levelEmojis = {
@@ -343,7 +343,7 @@ class PrettyPrinter extends LogPrinter {
343343
if (colors) {
344344
return levelColors[level]!;
345345
} else {
346-
return AnsiColor.none();
346+
return const AnsiColor.none();
347347
}
348348
}
349349

lib/src/printers/simple_printer.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class SimplePrinter extends LogPrinter {
2020

2121
static final levelColors = {
2222
Level.verbose: AnsiColor.fg(AnsiColor.grey(0.5)),
23-
Level.debug: AnsiColor.none(),
24-
Level.info: AnsiColor.fg(12),
25-
Level.warning: AnsiColor.fg(208),
26-
Level.error: AnsiColor.fg(196),
27-
Level.wtf: AnsiColor.fg(199),
23+
Level.debug: const AnsiColor.none(),
24+
Level.info: const AnsiColor.fg(12),
25+
Level.warning: const AnsiColor.fg(208),
26+
Level.error: const AnsiColor.fg(196),
27+
Level.wtf: const AnsiColor.fg(199),
2828
};
2929

3030
final bool printTime;

0 commit comments

Comments
 (0)