FeatureDiscovery constructor

FeatureDiscovery({
  1. required Widget child,
  2. bool recordStepsInSharedPreferences = true,
  3. String? sharedPreferencesPrefix,
  4. Key? key,
})

Instantiates a new FeatureDiscovery.

If recordStepsInSharedPreferences is true, the completion of the steps will be recorded in the Shared Preferences.

If sharedPreferencesPrefix is provided, it will added before the feature ids to form the keys for the Shared Preferences.

The key for each step will be

'${sharedPreferencesPrefix}${featureId}'

sharedPreferencesPrefix is used only if recordStepsInSharedPreferences is true.

Implementation

factory FeatureDiscovery({
  required Widget child,
  bool recordStepsInSharedPreferences = true,
  String? sharedPreferencesPrefix,
  Key? key,
}) =>
    FeatureDiscovery.withProvider(
      key: key,
      persistenceProvider: recordStepsInSharedPreferences == true
          ? SharedPreferencesProvider(sharedPreferencesPrefix)
          : const NoPersistenceProvider(),
      child: child,
    );