debugAssertNoTransientCallbacks method

  1. @override
bool debugAssertNoTransientCallbacks(
  1. String reason
)
override

Asserts that there are no registered transient callbacks; if there are, prints their locations and throws an exception.

A transient frame callback is one that was registered with scheduleFrameCallback.

This is expected to be called at the end of tests (the flutter_test framework does it automatically in normal cases).

Call this method when you expect there to be no transient callbacks registered, in an assert statement with a message that you want printed when a transient callback is registered:

assert(SchedulerBinding.instance.debugAssertNoTransientCallbacks(
  'A leak of transient callbacks was detected while doing foo.'
));

Does nothing if asserts are disabled. Always returns true.

Implementation

@override
bool debugAssertNoTransientCallbacks(String reason) {
  throw UnimplementedError();
}