Skip to content

Commit b287770

Browse files
committed
code_block [nfc]: Make CodeBlockTextStyles.lerp static
Discussion: #746 (comment)
1 parent 08da705 commit b287770

File tree

2 files changed

+66
-66
lines changed

2 files changed

+66
-66
lines changed

lib/widgets/code_block.dart

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -477,73 +477,73 @@ class CodeBlockTextStyles {
477477
};
478478
}
479479

480-
CodeBlockTextStyles lerp(CodeBlockTextStyles other, double t) {
481-
if (identical(this, other)) return this;
480+
static CodeBlockTextStyles lerp(CodeBlockTextStyles a, CodeBlockTextStyles b, double t) {
481+
if (identical(a, b)) return a;
482482

483483
return CodeBlockTextStyles._(
484-
plain: TextStyle.lerp(plain, other.plain, t)!,
485-
hll: TextStyle.lerp(_hll, other._hll, t)!,
486-
c: TextStyle.lerp(_c, other._c, t)!,
487-
err: TextStyle.lerp(_err, other._err, t)!,
488-
k: TextStyle.lerp(_k, other._k, t)!,
489-
o: TextStyle.lerp(_o, other._o, t)!,
490-
cm: TextStyle.lerp(_cm, other._cm, t)!,
491-
cp: TextStyle.lerp(_cp, other._cp, t)!,
492-
c1: TextStyle.lerp(_c1, other._c1, t)!,
493-
cs: TextStyle.lerp(_cs, other._cs, t)!,
494-
gd: TextStyle.lerp(_gd, other._gd, t)!,
495-
ge: TextStyle.lerp(_ge, other._ge, t)!,
496-
gr: TextStyle.lerp(_gr, other._gr, t)!,
497-
gh: TextStyle.lerp(_gh, other._gh, t)!,
498-
gi: TextStyle.lerp(_gi, other._gi, t)!,
499-
go: TextStyle.lerp(_go, other._go, t)!,
500-
gp: TextStyle.lerp(_gp, other._gp, t)!,
501-
gs: TextStyle.lerp(_gs, other._gs, t)!,
502-
gu: TextStyle.lerp(_gu, other._gu, t)!,
503-
gt: TextStyle.lerp(_gt, other._gt, t)!,
504-
kc: TextStyle.lerp(_kc, other._kc, t)!,
505-
kd: TextStyle.lerp(_kd, other._kd, t)!,
506-
kn: TextStyle.lerp(_kn, other._kn, t)!,
507-
kp: TextStyle.lerp(_kp, other._kp, t)!,
508-
kr: TextStyle.lerp(_kr, other._kr, t)!,
509-
kt: TextStyle.lerp(_kt, other._kt, t)!,
510-
m: TextStyle.lerp(_m, other._m, t)!,
511-
s: TextStyle.lerp(_s, other._s, t)!,
512-
na: TextStyle.lerp(_na, other._na, t)!,
513-
nb: TextStyle.lerp(_nb, other._nb, t)!,
514-
nc: TextStyle.lerp(_nc, other._nc, t)!,
515-
no: TextStyle.lerp(_no, other._no, t)!,
516-
nd: TextStyle.lerp(_nd, other._nd, t)!,
517-
ni: TextStyle.lerp(_ni, other._ni, t)!,
518-
ne: TextStyle.lerp(_ne, other._ne, t)!,
519-
nf: TextStyle.lerp(_nf, other._nf, t)!,
520-
nl: TextStyle.lerp(_nl, other._nl, t)!,
521-
nn: TextStyle.lerp(_nn, other._nn, t)!,
522-
nt: TextStyle.lerp(_nt, other._nt, t)!,
523-
nv: TextStyle.lerp(_nv, other._nv, t)!,
524-
nx: TextStyle.lerp(_nx, other._nx, t)!,
525-
ow: TextStyle.lerp(_ow, other._ow, t)!,
526-
w: TextStyle.lerp(_w, other._w, t)!,
527-
mf: TextStyle.lerp(_mf, other._mf, t)!,
528-
mh: TextStyle.lerp(_mh, other._mh, t)!,
529-
mi: TextStyle.lerp(_mi, other._mi, t)!,
530-
mo: TextStyle.lerp(_mo, other._mo, t)!,
531-
sb: TextStyle.lerp(_sb, other._sb, t)!,
532-
sc: TextStyle.lerp(_sc, other._sc, t)!,
533-
sd: TextStyle.lerp(_sd, other._sd, t)!,
534-
s2: TextStyle.lerp(_s2, other._s2, t)!,
535-
se: TextStyle.lerp(_se, other._se, t)!,
536-
sh: TextStyle.lerp(_sh, other._sh, t)!,
537-
si: TextStyle.lerp(_si, other._si, t)!,
538-
sx: TextStyle.lerp(_sx, other._sx, t)!,
539-
sr: TextStyle.lerp(_sr, other._sr, t)!,
540-
s1: TextStyle.lerp(_s1, other._s1, t)!,
541-
ss: TextStyle.lerp(_ss, other._ss, t)!,
542-
bp: TextStyle.lerp(_bp, other._bp, t)!,
543-
vc: TextStyle.lerp(_vc, other._vc, t)!,
544-
vg: TextStyle.lerp(_vg, other._vg, t)!,
545-
vi: TextStyle.lerp(_vi, other._vi, t)!,
546-
il: TextStyle.lerp(_il, other._il, t)!,
484+
plain: TextStyle.lerp(a.plain, b.plain, t)!,
485+
hll: TextStyle.lerp(a._hll, b._hll, t)!,
486+
c: TextStyle.lerp(a._c, b._c, t)!,
487+
err: TextStyle.lerp(a._err, b._err, t)!,
488+
k: TextStyle.lerp(a._k, b._k, t)!,
489+
o: TextStyle.lerp(a._o, b._o, t)!,
490+
cm: TextStyle.lerp(a._cm, b._cm, t)!,
491+
cp: TextStyle.lerp(a._cp, b._cp, t)!,
492+
c1: TextStyle.lerp(a._c1, b._c1, t)!,
493+
cs: TextStyle.lerp(a._cs, b._cs, t)!,
494+
gd: TextStyle.lerp(a._gd, b._gd, t)!,
495+
ge: TextStyle.lerp(a._ge, b._ge, t)!,
496+
gr: TextStyle.lerp(a._gr, b._gr, t)!,
497+
gh: TextStyle.lerp(a._gh, b._gh, t)!,
498+
gi: TextStyle.lerp(a._gi, b._gi, t)!,
499+
go: TextStyle.lerp(a._go, b._go, t)!,
500+
gp: TextStyle.lerp(a._gp, b._gp, t)!,
501+
gs: TextStyle.lerp(a._gs, b._gs, t)!,
502+
gu: TextStyle.lerp(a._gu, b._gu, t)!,
503+
gt: TextStyle.lerp(a._gt, b._gt, t)!,
504+
kc: TextStyle.lerp(a._kc, b._kc, t)!,
505+
kd: TextStyle.lerp(a._kd, b._kd, t)!,
506+
kn: TextStyle.lerp(a._kn, b._kn, t)!,
507+
kp: TextStyle.lerp(a._kp, b._kp, t)!,
508+
kr: TextStyle.lerp(a._kr, b._kr, t)!,
509+
kt: TextStyle.lerp(a._kt, b._kt, t)!,
510+
m: TextStyle.lerp(a._m, b._m, t)!,
511+
s: TextStyle.lerp(a._s, b._s, t)!,
512+
na: TextStyle.lerp(a._na, b._na, t)!,
513+
nb: TextStyle.lerp(a._nb, b._nb, t)!,
514+
nc: TextStyle.lerp(a._nc, b._nc, t)!,
515+
no: TextStyle.lerp(a._no, b._no, t)!,
516+
nd: TextStyle.lerp(a._nd, b._nd, t)!,
517+
ni: TextStyle.lerp(a._ni, b._ni, t)!,
518+
ne: TextStyle.lerp(a._ne, b._ne, t)!,
519+
nf: TextStyle.lerp(a._nf, b._nf, t)!,
520+
nl: TextStyle.lerp(a._nl, b._nl, t)!,
521+
nn: TextStyle.lerp(a._nn, b._nn, t)!,
522+
nt: TextStyle.lerp(a._nt, b._nt, t)!,
523+
nv: TextStyle.lerp(a._nv, b._nv, t)!,
524+
nx: TextStyle.lerp(a._nx, b._nx, t)!,
525+
ow: TextStyle.lerp(a._ow, b._ow, t)!,
526+
w: TextStyle.lerp(a._w, b._w, t)!,
527+
mf: TextStyle.lerp(a._mf, b._mf, t)!,
528+
mh: TextStyle.lerp(a._mh, b._mh, t)!,
529+
mi: TextStyle.lerp(a._mi, b._mi, t)!,
530+
mo: TextStyle.lerp(a._mo, b._mo, t)!,
531+
sb: TextStyle.lerp(a._sb, b._sb, t)!,
532+
sc: TextStyle.lerp(a._sc, b._sc, t)!,
533+
sd: TextStyle.lerp(a._sd, b._sd, t)!,
534+
s2: TextStyle.lerp(a._s2, b._s2, t)!,
535+
se: TextStyle.lerp(a._se, b._se, t)!,
536+
sh: TextStyle.lerp(a._sh, b._sh, t)!,
537+
si: TextStyle.lerp(a._si, b._si, t)!,
538+
sx: TextStyle.lerp(a._sx, b._sx, t)!,
539+
sr: TextStyle.lerp(a._sr, b._sr, t)!,
540+
s1: TextStyle.lerp(a._s1, b._s1, t)!,
541+
ss: TextStyle.lerp(a._ss, b._ss, t)!,
542+
bp: TextStyle.lerp(a._bp, b._bp, t)!,
543+
vc: TextStyle.lerp(a._vc, b._vc, t)!,
544+
vg: TextStyle.lerp(a._vg, b._vg, t)!,
545+
vi: TextStyle.lerp(a._vi, b._vi, t)!,
546+
il: TextStyle.lerp(a._il, b._il, t)!,
547547
);
548548
}
549549
}

lib/widgets/content.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
105105
}
106106
return ContentTheme._(
107107
textStylePlainParagraph: TextStyle.lerp(textStylePlainParagraph, other.textStylePlainParagraph, t)!,
108-
codeBlockTextStyles: codeBlockTextStyles.lerp(other.codeBlockTextStyles, t),
108+
codeBlockTextStyles: CodeBlockTextStyles.lerp(codeBlockTextStyles, other.codeBlockTextStyles, t),
109109
textStyleError: TextStyle.lerp(textStyleError, other.textStyleError, t)!,
110110
textStyleErrorCode: TextStyle.lerp(textStyleErrorCode, other.textStyleErrorCode, t)!,
111111
);

0 commit comments

Comments
 (0)