leak_tracker_flutter_testing library

Classes

IgnoredLeaks
The total set of ignored leaks.
InstrumentedDisposable
Example of instrumented disposable.
LeakingClass
Example of leaking class.
LeakReport
Leak information, passed from application to DevTools and than extended by DevTools after deeper analysis.
Leaks
Detailed information about found leaks.
LeakTestCase
A test case to verify leak detection.
LeakTesting
leak_tracker settings for tests.
LeakTracking
Provides leak tracking functionality.
LeakTrackingTestConfig
Configuration for leak tracking to pass to an individual unit test.
StatelessLeakingWidget
Example of stateless leaking widget.

Enums

LeakType

Constants

isLeakFree → const Matcher
Checks if the leak collection is empty.

Properties

areCreateAndDispose Matcher
Checks if Iterable contains two events, first ObjectCreated and then ObjectDisposed.
getter/setter pair
leakTestingSettingsCases Map<String, LeakTesting Function(LeakTesting settings)>
Test cases for leak detection settings.
final

Functions

maybeSetupLeakTrackingForTest(LeakTesting? settings, String testDescription) → void
Makes sure leak tracking is set up for a test.
maybeTearDownLeakTrackingForAll() Future<void>
Should be invoked after execution of all tests to report found leaks.
maybeTearDownLeakTrackingForTest() → void
If leak tracking is enabled, stops it and declares notDisposed objects as leaks.
memoryEvents(FutureOr<void> callback(), Type type) Future<List<ObjectEvent>>
Invokes callback and collects events dispatched to FlutterMemoryAllocations.instance for type.

Typedefs

PumpWidgetsCallback = Future<void> Function(Widget widget, [Duration? duration])
Signature of pumpWidget method.
RunAsyncCallback<T> = Future<T?> Function(Future<T> callback())
Signature of runAsync method.
TestCallback = Future<void> Function(PumpWidgetsCallback? pumpWidgets, RunAsyncCallback? runAsync)
Callback for test body, with access to Flutter specific test methods.