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

A Flutter package for creating interactive step-by-step tutorials with overlays.

tutorial_overlay #

tutorial_overlay is a Flutter package that makes it easy to create interactive, step-by-step tutorials in your app. It overlays highlights on specific widgets and guides users with custom tooltips and indicators, perfect for onboarding or feature discovery.

✨ Features #

  • Step-by-Step Guidance: Highlight widgets and walk users through your app.
  • Custom Tooltips: Add any widget (text, buttons, images, etc.) to explain each step.
  • Custom Indicators: Use arrows or icons to point users to the right spot.
  • Multi-Page Support: Keep the tutorial flowing across different screens.

Example #

git clone https://github.com/xinyi-chong/tutorial_overlay.git
cd tutorial_overlay/example
flutter run

Screenshots & Demonstrations #

Here are some examples showcasing the features of tutorial_overlay:

Tutorial Across Pages Update Support Custom Indicator Tutorial Without Target Widget

Steps across multiple pages.

E.g. Updates on language change.

Getting started #

Installation #

Add tutorial_overlay to your pubspec.yaml:

dependencies:
    tutorial_overlay: ^<latest_version>

Run:

flutter pub get

Check the pub.dev page for the latest version.

Usage #

  1. Use a GlobalKey to mark the widget you want to highlight (e.g., a button):
final helpButtonKey = GlobalKey();

IconButton(
    key: helpButtonKey,
    onPressed: () {
      tutorial.startTutorial('home');
    },
    icon: Icon(Icons.help),
)
  1. Define Tutorial Steps and wrap your app with the tutorial provider:


void main() {
  final tutorial = Tutorial<String>({
    'home': [
      TutorialStep(
        widgetKey: helpButtonKey,
        child: const Text('Tap here to get help'),
      ),
    ],
  });

  runApp(tutorial.provide(const MyApp()));
}
  1. Wrap your page with TutorialOverlay, specifying the tutorialId:
class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: TutorialOverlay<String>(
        tutorialId: 'home',  // Matches the key in the tutorial map
        child: const MyHomePage(),
      ),
    );
  }
}
  1. Control the Tutorial
  tutorial.startTutorial('home');
  tutorial.nextStep('home');
  tutorial.previousStep('home');
  tutorial.endTutorial('home');

Navigation: To move between pages, use:

tutorial.nextStep('home', route: '/your-page', context: context); // Navigate to a new route
tutorial.previousStep('home', backToPreviousPage: true, context: context); // Go back
  1. Updating Tutorial You can dynamically update the tutorials after initialization by using updateTutorial:
  tutorial.updateTutorial(newTutorial);
0
likes
160
points
128
downloads
screenshot

Publisher

unverified uploader

Weekly Downloads

A Flutter package for creating interactive step-by-step tutorials with overlays.

Repository (GitHub)

Topics

#tutorial #tooltip #overlay

Documentation

API reference

License

MIT (license)

Dependencies

flutter, provider

More

Packages that depend on tutorial_overlay