From 6c43de5f2cce9714e520c2105edada49e2420150 Mon Sep 17 00:00:00 2001 From: Rexios Date: Mon, 20 Nov 2023 22:24:21 -0500 Subject: [PATCH] Actually use text property in notifications --- .../lib/controller/score_fetch_controller.dart | 2 +- pub_stats_collector/lib/model/diff.dart | 6 +++--- pub_stats_collector/lib/repo/discord_repo.dart | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pub_stats_collector/lib/controller/score_fetch_controller.dart b/pub_stats_collector/lib/controller/score_fetch_controller.dart index be2dd4a..5d8eca1 100644 --- a/pub_stats_collector/lib/controller/score_fetch_controller.dart +++ b/pub_stats_collector/lib/controller/score_fetch_controller.dart @@ -110,7 +110,7 @@ class ScoreFetchController { StringDiff(previousData.isFlutterFavorite, data.isFlutterFavorite), PackageDataField.dependents: SetDiff(previousData.dependents, data.dependents), - }..removeWhere((key, value) => !value.isDifferent); + }..removeWhere((key, value) => !value.different); } else { changes = {}; } diff --git a/pub_stats_collector/lib/model/diff.dart b/pub_stats_collector/lib/model/diff.dart index 7c3fc6f..64f1faf 100644 --- a/pub_stats_collector/lib/model/diff.dart +++ b/pub_stats_collector/lib/model/diff.dart @@ -6,7 +6,7 @@ abstract class Diff { Diff(this.before, this.after); - bool get isDifferent; + bool get different; String get text; } @@ -14,7 +14,7 @@ class StringDiff extends Diff { StringDiff(super.before, super.after); @override - bool get isDifferent => before != after; + bool get different => before != after; @override String get text => '$before -> $after'; @@ -24,7 +24,7 @@ class SetDiff extends Diff> { SetDiff(super.before, super.after); @override - bool get isDifferent => !const SetEquality().equals(before, after); + bool get different => !const SetEquality().equals(before, after); @override String get text { diff --git a/pub_stats_collector/lib/repo/discord_repo.dart b/pub_stats_collector/lib/repo/discord_repo.dart index aafcaa9..505d8dd 100644 --- a/pub_stats_collector/lib/repo/discord_repo.dart +++ b/pub_stats_collector/lib/repo/discord_repo.dart @@ -43,7 +43,7 @@ class DiscordRepo { ...changes.entries.map( (e) => EmbedField( name: e.key.name.titleCase, - value: '${e.value.before} -> ${e.value.after}', + value: e.value.text, ), ), if (warnings.isNotEmpty)