Clue.dialog constructor
Clue.dialog({
- required String id,
- InteractableRenderSettings? renderSettings,
- Action<
InteractableTooltip> onHover = _defaultOnHover, - Padlock? padlock,
- String? keyId,
- EscapeGameDialog? noKeyDialog,
- EscapeGameDialog? clueDialog,
- bool removeAfterFound = false,
- InteractableTooltip? removedTooltip,
Creates a new Clue instance by providing some dialogs.
Implementation
Clue.dialog({
required String id,
InteractableRenderSettings? renderSettings,
Action<InteractableTooltip> onHover = _defaultOnHover,
Padlock? padlock,
String? keyId,
EscapeGameDialog? noKeyDialog,
EscapeGameDialog? clueDialog,
bool removeAfterFound = false,
InteractableTooltip? removedTooltip,
}) : this(
id: id,
renderSettings: renderSettings,
onHover: onHover,
padlock: padlock,
keyId: keyId,
onCantUnlock: (escapeGame) {
if (noKeyDialog != null) {
escapeGame.showDialog(noKeyDialog);
}
return const ActionResult.failed();
},
onFound: (escapeGame) {
if (clueDialog != null) {
escapeGame.showDialog(clueDialog);
}
return const ActionResult.success();
},
removeAfterFound: removeAfterFound,
removedTooltip: removedTooltip,
);