show static method

void show(
  1. BuildContext context, {
  2. required Offset fromCenter,
  3. required Offset toCenter,
  4. required double orbSize,
  5. Uint8List? lottieBytes,
  6. String? lottieUrl,
  7. String? imageUrl,
  8. required List<Color> brandColors,
  9. required VoidCallback onLanded,
  10. VoidCallback? onComplete,
})

Mount the awakening overlay.

Implementation

static void show(
  BuildContext context, {
  required Offset fromCenter,
  required Offset toCenter,
  required double orbSize,
  Uint8List? lottieBytes,
  String? lottieUrl,
  String? imageUrl,
  required List<Color> brandColors,
  required VoidCallback onLanded,
  VoidCallback? onComplete,
}) {
  if (_entry != null) return;
  // Backend theming/tuning: `colors.awakeningGradient` replaces the widget
  // brand gradient for the orb; `effects.awakening.orbSize` overrides the
  // FAB-derived diameter.
  brandColors = ActionGates.instance.awakeningGradient ?? brandColors;
  orbSize = ActionGates.instance.effects.awakeningOrbSize ?? orbSize;
  final overlay = _resolveOverlay(context);
  if (overlay == null) {
    onLanded();
    onComplete?.call();
    return;
  }
  late OverlayEntry entry;
  entry = OverlayEntry(
    builder: (_) => _AwakeningLayer(
      fromCenter: fromCenter,
      toCenter: toCenter,
      orbSize: orbSize,
      lottieBytes: lottieBytes,
      lottieUrl: lottieUrl,
      imageUrl: imageUrl,
      brandColors: brandColors,
      reverse: false,
      onLanded: onLanded,
      onStateInit: (_) {},
      onDone: () {
        if (_entry == entry) {
          entry.remove();
          _entry = null;
        }
        onComplete?.call();
      },
    ),
  );
  _entry = entry;
  overlay.insert(entry);
}