initialize function
Widget
initialize({
- required Widget child,
- Config? config,
- LogLevel loggingLevel = LogLevel.off,
- LocalRenderCallback? localRenderCallback,
- 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));
}