Skip to content

Commit 0fd8924

Browse files
chrisbobbegnprice
authored andcommitted
model test [nfc]: Use .dark() in StreamColorSwatch.lerp test
Instead of a hard-coded value.
1 parent 4e16c2f commit 0fd8924

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

lib/api/model/model.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,6 @@ class StreamColorSwatch extends ColorSwatch<StreamColorVariant> {
468468

469469
const StreamColorSwatch._(int base, this._swatch) : super(base, _swatch);
470470

471-
/// A [StreamColorSwatch], from a [Map<_StreamColorVariant, Color>]
472-
/// written manually.
473-
@visibleForTesting
474-
const StreamColorSwatch.debugFromBaseAndSwatch(int base, swatch)
475-
: this._(base, swatch);
476-
477471
final Map<StreamColorVariant, Color> _swatch;
478472

479473
/// The [Subscription.color] int that the swatch is based on.

test/api/model/model_test.dart

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -517,17 +517,7 @@ void main() {
517517

518518
test('lerp (different a, b)', () {
519519
final swatchA = StreamColorSwatch.light(0xff76ce90);
520-
521-
// TODO(#95) use something like StreamColorSwatch.dark(), once
522-
// implemented, and remove debugFromBaseAndSwatch
523-
const swatchB = StreamColorSwatch.debugFromBaseAndSwatch(0xff76ce90, <StreamColorVariant, Color>{
524-
StreamColorVariant.base: Color(0xff76ce90),
525-
StreamColorVariant.unreadCountBadgeBackground: Color(0x4d65bd80),
526-
StreamColorVariant.iconOnPlainBackground: Color(0xff73cb8d),
527-
StreamColorVariant.iconOnBarBackground: Color(0xff73cb8d),
528-
StreamColorVariant.barBackground: Color(0xff2e4935),
529-
});
530-
520+
final swatchB = StreamColorSwatch.dark(0xff76ce90);
531521
for (final t in [0.0, 0.5, 1.0, -0.1, 1.1]) {
532522
final result = StreamColorSwatch.lerp(swatchA, swatchB, t)!;
533523
for (final variant in StreamColorVariant.values) {

0 commit comments

Comments
 (0)