Skip to main content

spotlyt 1.0.1 copy "spotlyt: ^1.0.1" to clipboard
spotlyt: ^1.0.1 copied to clipboard

A simple spotlight overlay for highlighting widgets in Flutter apps.

[Example banner]

Spotlyt #

✨ Spotlight-style widget highlighting with blur + dim overlays.

Spotlyt lets you guide users through UI by highlighting specific widgets while dimming or blurring the background.
Useful for onboarding, feature discovery, in-app tutorials, upgrade prompts, and walkthrough flows.


⭐ Features #

✔ Highlight single or multiple widgets
✔ Blur, dim or both at the same time
✔ Focus window with adjustable border radius & padding
✔ Per-target interaction control (tap-through or absorb)
✔ Overlay UI builder above spotlight
✔ Works anywhere — no widget restructuring
✔ Implemented using OverlayEntry
✔ Material context inheritance supported


📦 Installation #

dependencies:
  spotlyt: ^1.0.0
import 'package:spotlyt/spotlyt.dart';

🚀 Quick Example: Highlight One Widget #

final targetKey = GlobalKey();

Spotlyt.instance.show(
  context: context,
  targetKey: targetKey,
  padding: 10,
  borderRadius: 18,
  blurSigma: 14,
  dimColor: Colors.black.withOpacity(0.6),
  dismissOnTapOutside: true,
);

Attach the key:

Container(
  key: targetKey,
  child: ...
)

⭐ Highlight Multiple Widgets #

Spotlyt.instance.showMany(
  context: context,
  targets: [
    SpotlytTargetConfig(
      key: summaryKey,
      padding: 16,
      borderRadius: 20,
    ),
    SpotlytTargetConfig(
      key: buttonKey,
      padding: 8,
      borderRadius: 999,
      absorbTouchesInsideHole: true,
    ),
  ],
  blurSigma: 16,
  dimColor: Colors.black.withOpacity(0.65),
  dismissOnTapOutside: false,
  onDismiss: () {
    print("Highlight closed");
  },
);

🎨 Showing Custom Content Above Spotlight #

You can show custom overlay UI (like callouts, tooltips, buttons, instructions):

Spotlyt.instance.showMany(
  context: context,
  targets: [...],
  overlayBuilder: (context, targets) {
    return Positioned(
      bottom: 32,
      left: 0,
      right: 0,
      child: Center(
        child: FilledButton(
          onPressed: Spotlyt.instance.hide,
          child: const Text("Got it!"),
        ),
      ),
    );
  },
);

This widget is rendered above all blur/dim effects.


⚙️ SpotlytTargetConfig Options #

Property Type Description
key GlobalKey Widget to highlight
padding double Expand highlight area
borderRadius double Roundness of cutout
absorbTouchesInsideHole bool Control tap behavior

Example:

SpotlytTargetConfig(
  key: buttonKey,
  padding: 8,
  borderRadius: 999,
  absorbTouchesInsideHole: true,
)

🎯 Touch Behavior Explained #

Inside spotlight hole #

Depends on absorbTouchesInsideHole

absorbTouchesInsideHole Behavior
false taps pass through to widget below
true taps stay on overlay (useful for onboarding UIs)

Outside spotlight hole #

  • tap always goes to overlay
  • can dismiss highlight
  • can trigger custom UI callback

❌ Hiding Spotlight #

Spotlyt.instance.hide();

📄 Full Example #

Check complete runnable example in:

example/lib/main.dart

🧩 Real Use Cases #

🟣 Feature discovery
🟣 What’s new screens
🟣 Onboarding tutorial
🟣 Call-to-action promotion
🟣 Explain complex UI sections
🟣 Guided navigation flows


💬 Contributing #

Pull requests, ideas & improvements are welcome.

If you discover a feature that could improve onboarding UX — open an issue!
Spotlyt aims to make highlighting intuitive and beautifully animated out-of-box.


✦ Make your UI stand out, one highlight at a time ✦

1
likes
0
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A simple spotlight overlay for highlighting widgets in Flutter apps.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on spotlyt