ensureInitialized static method
Ensures the Infospect
instance is initialized.
If it's not initialized, it will initialize it with the provided arguments.
Returns the initialized instance of Infospect
.
Implementation
static Infospect ensureInitialized({
int maxCallsCount = 1000,
GlobalKey<NavigatorState>? navigatorKey,
bool logAppLaunch = false,
void Function(String path)? onShareAllNetworkCalls,
void Function(String path)? onShareAllLogs,
}) {
if (Infospect._instance == null) {
Infospect._(
maxCallsCount: maxCallsCount,
navigatorKey: navigatorKey,
logAppLaunch: logAppLaunch,
onShareAllLogs: onShareAllLogs,
onShareAllNetworkCalls: onShareAllNetworkCalls,
);
}
return Infospect.instance;
}