init static method
Implementation
static OverlayLoaderManager init({
String? semantics,
Color? backgroundColor,
Color colorProgressIndicator = Colors.white,
}) {
backgroundColor ??= Colors.black.withOpacity(0.5);
if (!getIt.isRegistered<OverlayLoaderManager>()) {
var overlayEntry = OverlayEntry(
builder: (context) => IgnorePointer(
child: Positioned.fill(
child: Semantics(
label: semantics ?? 'Loading',
child: ColoredBox(
color: backgroundColor!,
child: Center(
child: ExcludeSemantics(
child: CircularProgressIndicator(
color: colorProgressIndicator,
),
),
),
),
),
),
),
);
getIt.registerSingleton<OverlayLoaderManager>(
OverlayLoaderManager(overlayEntry),
);
}
return getIt.get<OverlayLoaderManager>();
}