ScanHistoryController class

Dedicated controller for managing, filtering, and exporting scan result history.

Inheritance

Constructors

ScanHistoryController({int maxHistorySize = 100})
Constructs a ScanHistoryController.

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
history List<ScanResult>
Unmodifiable list of recorded scan results.
no setter
historyStream Stream<List<ScanResult>>
Stream emitting updated scan history snapshots on changes.
no setter
isEmpty bool
Whether scan history log is empty.
no setter
length int
Total count of items in history log.
no setter
maxHistorySize int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(ScanResult result) → void
Adds a new ScanResult to history and trims beyond maxHistorySize.
addAll(List<ScanResult> results) → void
Adds multiple results to history log.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clear() → void
Clears all recorded scan results from history log.
dispose() → void
Discards any resources used by the object.
override
exportToCsv() String
Exports current history log as formatted CSV string.
exportToEncryptedJson({required String password, Duration? ttl}) EncryptedScanData
Exports current history log as encrypted JSON string using EncryptedStorage.
exportToJson({bool pretty = true}) String
Exports current history log as formatted JSON string.
exportToPdf({String title = 'Scan History Report'}) Future<Uint8List>
Exports current history log as enterprise PDF binary byte array buffer.
filterByDateRange(DateTime from, DateTime to) List<ScanResult>
Filters scan history by date range.
filterByMode(ScanMode mode) List<ScanResult>
Filters scan history by matching ScanMode.
getStatistics() Map<String, dynamic>
Returns summary statistics of current scan history.
importFromJson(String jsonString) int
Imports scan results from JSON payload and appends to history log.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeAt(int index) → void
Removes a scan result item at specified index.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
Filters scan history by search query term in raw payload or fields.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited