debugTrackProviderCreation top-level property

  1. @publicInMisc
bool debugTrackProviderCreation
getter/setter pair

A flag to control whether Riverpod should track the StackTrace of providers when they are created.

This is used by the devtool to enable navigating to the source of a provider.

No-op in release mode. Defaults to false as this can slow down provider creation.

To use, set to true before using any provider:

void main() {
  debugTrackProviderCreation = true;
  // Use Riverpod as normal
}

Make sure to hot-restart your application after changing this flag. The devtool should then automatically pick up the stack trace of providers.

Implementation

@publicInMisc
bool debugTrackProviderCreation = false;