@@ -8,12 +8,12 @@ import 'color.dart';
8
8
9
9
/// A lazily-computed map from a stream's base color to a
10
10
/// corresponding [ChannelColorSwatch] .
11
- abstract class StreamColorSwatches {
12
- /// The [StreamColorSwatches ] for the light theme.
13
- static final StreamColorSwatches light = _StreamColorSwatchesLight ();
11
+ abstract class ChannelColorSwatches {
12
+ /// The [ChannelColorSwatches ] for the light theme.
13
+ static final ChannelColorSwatches light = _ChannelColorSwatchesLight ();
14
14
15
- /// The [StreamColorSwatches ] for the dark theme.
16
- static final StreamColorSwatches dark = _StreamColorSwatchesDark ();
15
+ /// The [ChannelColorSwatches ] for the dark theme.
16
+ static final ChannelColorSwatches dark = _ChannelColorSwatchesDark ();
17
17
18
18
final Map <int , ChannelColorSwatch > _cache = {};
19
19
@@ -23,7 +23,7 @@ abstract class StreamColorSwatches {
23
23
24
24
ChannelColorSwatch _computeForBaseColor (int base );
25
25
26
- /// Gives a [StreamColorSwatches ] , lerped between [a] and [b] at [t] .
26
+ /// Gives a [ChannelColorSwatches ] , lerped between [a] and [b] at [t] .
27
27
///
28
28
/// If [a] and [b] are [identical] , returns [this] .
29
29
///
@@ -33,37 +33,37 @@ abstract class StreamColorSwatches {
33
33
/// This computation is cached on the instance
34
34
/// in order to save work building [t] 's animation frame when there are
35
35
/// multiple UI elements using the same [subscription.color] .
36
- static StreamColorSwatches lerp (StreamColorSwatches a, StreamColorSwatches b, double t) {
36
+ static ChannelColorSwatches lerp (ChannelColorSwatches a, ChannelColorSwatches b, double t) {
37
37
// This short-circuit helps when [a] and [b]
38
- // are both [StreamColorSwatches .light]
39
- // or both [StreamColorSwatches .dark].
38
+ // are both [ChannelColorSwatches .light]
39
+ // or both [ChannelColorSwatches .dark].
40
40
// Empirically, [lerp] is called even when the theme hasn't changed,
41
41
// so this is an important optimization.
42
42
if (identical (a, b)) return a;
43
43
44
- return _StreamColorSwatchesLerped (a, b, t);
44
+ return _ChannelColorSwatchesLerped (a, b, t);
45
45
}
46
46
}
47
47
48
- class _StreamColorSwatchesLight extends StreamColorSwatches {
49
- _StreamColorSwatchesLight ();
48
+ class _ChannelColorSwatchesLight extends ChannelColorSwatches {
49
+ _ChannelColorSwatchesLight ();
50
50
51
51
@override
52
52
ChannelColorSwatch _computeForBaseColor (int base ) => ChannelColorSwatch .light (base );
53
53
}
54
54
55
- class _StreamColorSwatchesDark extends StreamColorSwatches {
56
- _StreamColorSwatchesDark ();
55
+ class _ChannelColorSwatchesDark extends ChannelColorSwatches {
56
+ _ChannelColorSwatchesDark ();
57
57
58
58
@override
59
59
ChannelColorSwatch _computeForBaseColor (int base ) => ChannelColorSwatch .dark (base );
60
60
}
61
61
62
- class _StreamColorSwatchesLerped extends StreamColorSwatches {
63
- _StreamColorSwatchesLerped (this .a, this .b, this .t);
62
+ class _ChannelColorSwatchesLerped extends ChannelColorSwatches {
63
+ _ChannelColorSwatchesLerped (this .a, this .b, this .t);
64
64
65
- final StreamColorSwatches a;
66
- final StreamColorSwatches b;
65
+ final ChannelColorSwatches a;
66
+ final ChannelColorSwatches b;
67
67
final double t;
68
68
69
69
@override
0 commit comments