File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ class DatabaseTracker {
2727 /// Whether this [DatabaseTracker] has been disposed.
2828 bool _isDisposed = false ;
2929
30+ /// Public getter to check if this tracker has been disposed.
31+ bool get isDisposed => _isDisposed;
32+
3033 /// Creates a new tracker with necessary tables.
3134 DatabaseTracker ()
3235 : _db = sqlite3.open (
Original file line number Diff line number Diff line change @@ -61,5 +61,12 @@ void main() {
6161 expect (() => tracker.dispose (), returnsNormally);
6262 expect (() => tracker.dispose (), returnsNormally);
6363 });
64+
65+ test ('isDisposed reflects tracker state' , () {
66+ expect (tracker.isDisposed, isFalse);
67+
68+ tracker.dispose ();
69+ expect (tracker.isDisposed, isTrue);
70+ });
6471 });
6572}
You can’t perform that action at this time.
0 commit comments