Skip to content

Commit 82e2f43

Browse files
committed
added separate AppAnalyser.onDataCollected setter for more flexibility
1 parent 7691c66 commit 82e2f43

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/src/analyser.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ class AppAnalyser {
2727
AnalysisStoragePurgeInterface get storage => _storage;
2828

2929
bool _initialised = false;
30-
Timer? _timer;
31-
DateTime? _startedAt;
32-
AnalysisInfo? _info;
33-
3430
void initialise({
3531
ValueChanged<AnalysisDataInterface>? onDataCollected,
3632
Duration measurementFrequency = const Duration(seconds: 5),
@@ -60,6 +56,12 @@ class AppAnalyser {
6056
_initialised = true;
6157
}
6258

59+
set onDataCollected(ValueChanged<AnalysisDataInterface> callback) =>
60+
_onDataCollected = callback;
61+
62+
Timer? _timer;
63+
DateTime? _startedAt;
64+
AnalysisInfo? _info;
6365
Future<AnalysisInfoInterface> start() async {
6466
if (_timer != null || _startedAt != null) {
6567
throw AnalysisInProgressException();

0 commit comments

Comments
 (0)