show static method
void
show(})
Inserts a self-removing FloatingComboText into context's Overlay
at alignment, and removes it again once the animation finishes — no
leftover OverlayEntry or AnimationController to manage.
Implementation
static void show(
BuildContext context, {
required String text,
Color? color,
double fontSize = 22,
Duration duration = const Duration(milliseconds: 900),
Alignment alignment = Alignment.center,
}) {
final overlay = Overlay.of(context, rootOverlay: true);
late OverlayEntry entry;
entry = OverlayEntry(
builder: (context) => Positioned.fill(
child: IgnorePointer(
child: Align(
alignment: alignment,
child: FloatingComboText(
text: text,
color: color,
fontSize: fontSize,
duration: duration,
onDone: () {
if (entry.mounted) entry.remove();
},
),
),
),
),
);
overlay.insert(entry);
}