setGlobalConfig static method
void
setGlobalConfig({
- bool? force,
- String? preferencePrefix,
- ChildConfig? childConfig,
- IntroduceConfig? introduceConfig,
- PreDialogConfig? preDialogConfig,
- SkipConfig? skipConfig,
- NextConfig? nextConfig,
- DoneConfig? doneConfig,
- bool? debugLog,
Sets the global configs.
force to show or hide all the instructions, including pre-dialogs.
The default is null, which means it depends on its own start configuration.
preferencePrefix is the prefix for the shared preferences.
childConfig to configure the child widget.
introduceConfig to configure the introduce widget.
preDialogConfig to configure the pre-dialog widget.
skipConfig and nextConfig to configure the Skip and Next buttons.
debugLog allows printing the debug logs. The default is kDebugMode.
Ex:
setGlobalConfig(
childConfig: ChildConfig(
backgroundColor : Colors.white,
),
skipConfig: SkipConfig(
text: 'SKIP >>>',
),
introduceConfig: IntroduceConfig(
backgroundColor = Colors.black,
),
);
Implementation
static void setGlobalConfig({
/// Forces all [FeaturesTour] to be shown if this value is `true`, and not
/// shown if this value is `false`. The default is `null`, which only shows
/// if there are new [FeaturesTour]s.
///
/// **You have to set this value to `null` before release to make the package
/// work as expected.**
bool? force,
/// The prefix of the local database name to save the widget's showing state.
/// The default is 'FeaturesTour'.
String? preferencePrefix,
/// The configuration of the fake [child] widget. The default is [ChildConfig.global].
ChildConfig? childConfig,
/// The configuration of the [introduce] widget. The default is [IntroduceConfig.global].
IntroduceConfig? introduceConfig,
/// The configuration of the pre-dialog widget. The default is [PreDialogConfig.global].
PreDialogConfig? preDialogConfig,
/// The configuration of the skip button. The default is [SkipConfig.global].
SkipConfig? skipConfig,
/// The configuration of the next button. The default is [NextConfig.global].
NextConfig? nextConfig,
/// The configuration of the done button. The default is [DoneConfig.global].
///
/// This button is only shown when the current introduction is the last and
/// `doneConfig.enabled` is `true`.
DoneConfig? doneConfig,
/// Allows printing the debug logs. The default is `kDebugMode`.
bool? debugLog,
}) {
if (force != null) _force = force;
if (childConfig != null) ChildConfig.global = childConfig;
if (skipConfig != null) SkipConfig.global = skipConfig;
if (nextConfig != null) NextConfig.global = nextConfig;
if (doneConfig != null) DoneConfig.global = doneConfig;
if (introduceConfig != null) IntroduceConfig.global = introduceConfig;
if (preDialogConfig != null) PreDialogConfig.global = preDialogConfig;
if (preferencePrefix != null) _prefix = preferencePrefix;
if (debugLog != null) _debugLog = debugLog;
}