Skip to content

Commit

Permalink
Fix history
Browse files Browse the repository at this point in the history
  • Loading branch information
Frezyx committed Jan 3, 2024
1 parent 7c8d239 commit 9a07cb1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions examples/shop_app_example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,9 @@ packages:
talker:
dependency: "direct main"
description:
name: talker
sha256: "1e4351253560219859a8e757f5b8dbd266d5c289a50dd90d12da4f3041184392"
url: "https://pub.dev"
source: hosted
path: "../../packages/talker"
relative: true
source: path
version: "3.2.0"
talker_bloc_logger:
dependency: "direct main"
Expand Down
10 changes: 5 additions & 5 deletions packages/talker/lib/src/history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class DefaultTalkerHistory implements TalkerHistory {
final TalkerSettings settings;

/// Save locally
final _history = <TalkerDataInterface>[];
final _history = <TalkerData>[];

/// Return list of history
@override
List<TalkerDataInterface> get history => _history;
List<TalkerData> get history => _history;

@override
void clean() {
Expand All @@ -25,7 +25,7 @@ class DefaultTalkerHistory implements TalkerHistory {
}

@override
void write(TalkerDataInterface data) {
void write(TalkerData data) {
/// Check if you are authorized to write.
if (settings.useHistory && settings.enabled) {
/// Check if you have reached the max number of history and delete them.
Expand All @@ -44,12 +44,12 @@ class DefaultTalkerHistory implements TalkerHistory {
/// and logs [TalkerLog]s that have been sent
abstract class TalkerHistory {
/// Return List of [TalkerDataInterface]
List<TalkerDataInterface> get history;
List<TalkerData> get history;

/// Called when [Talker] handle [cleanHistory].
/// For example, [TalkerView] handle the [Talker.cleanHistory]
void clean();

/// Called when [Talker] handle an [TalkerDataInterface] log
void write(TalkerDataInterface data);
void write(TalkerData data);
}

0 comments on commit 9a07cb1

Please sign in to comment.