show static method
show.
Implementation
static void show(BuildContext context, [String? message]) {
_refCount++;
if (_overlay != null) return;
FocusManager.instance.primaryFocus?.unfocus();
_overlay = OverlayEntry(
builder: (context) => Material(
color: Colors.black26,
child: Center(
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const CircularProgressIndicator(),
if (message != null) ...[
const SizedBox(height: 16),
Text(
message,
style: const TextStyle(color: Colors.black87),
),
],
],
),
),
),
),
);
try {
Overlay.of(context).insert(_overlay!);
} catch (_) {
_overlay = null;
_refCount = 0;
}
}