Skip to main content
Version: 1.0.0

Spin the wheel Plugin

note

Ensure the basic integration of the Nudge Core SDK is complete. If not, check here.

Overview

The nudge_spinthewheelv2 package lets you add surveys to your flutter application.

Find the latest version of nudge_spinthewheelv2 here

Step 1: Installation

Add nudge_challenges_v2 to your pubspec.yaml file:

dependencies:
nudge_spinthewheelv2: ^latest_version

Run the following command to fetch the package:

flutter pub get

Step 2 : Initialization

Import the nudge_spinthewheelv2 package

import 'package:nudge_spinthewheelv2/nudge_flutter_spinthewheel_v2.dart';

Create an instance of NudgeSpinTheWheelUi()

 const nudgeSpinner = NudgeSpinTheWheelUi();

Add this instance to the plugins list in the NudgeProvider:

return NudgeProvider(
nudgeInstance: core,
plugins : [nudgeSpinner]
child: MaterialApp(
navigatorKey: NudgeProviderState.navigatorKey,
navigatorObservers : [_trackerObserver],
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Home(),
),
);

That's it!

Our Nudge Core would now trigger Spin the wheel defined on your Dashboard using the nudgeSpinner plugin.