initialize function

Widget initialize({
  1. required Widget child,
  2. Config? config,
  3. LogLevel loggingLevel = LogLevel.off,
  4. LocalRenderCallback? localRenderCallback,
  5. DataCallback? dataCallback,
})

Initializes the Round Spot library.

Takes a child widget, an optional config, a loggingLevel which defaults to LogLevel.off and output callbacks (localRenderCallback and dataCallback) that must be set depending on the Config.outputType requested.

Should be invoked in main() or otherwise wrap the MaterialApp widget:

void main() {
  runApp(rs.initialize(
    child: Application()
  ));
}

Implementation

Widget initialize({
  required Widget child,
  Config? config,
  LogLevel loggingLevel = LogLevel.off,
  LocalRenderCallback? localRenderCallback,
  DataCallback? dataCallback,
}) {
  _initializeLogger(loggingLevel);
  initializeComponents(config, localRenderCallback, dataCallback);
  return LifecycleObserver(child: Detector(areaID: '', child: child));
}