init method

void init({
  1. required BuildContext context,
  2. bool enableShake = true,
})

Initializes the overlay and logger options.

context is required for launching the overlay UI. enableShake enables shake-to-open gesture in debug mode. enableInRelease allows logger in release mode (disabled by default). performanceMode disables file writes for high-FPS apps (e.g., games).

Implementation

void init({required BuildContext context, bool enableShake = true}) {
  _shakeDetector?.stopListening(); // clean up old

  if (enableShake) {
    _shakeDetector = ShakeDetector.autoStart(
      onPhoneShake: (event) => SimpleLoggerOverlay.show(context),
      shakeThresholdGravity: 2.7,
    );
  }
}