NudgeButton class
Constructors
-
NudgeButton(NudgeBox box, {required String label, required NudgeButtonVariant variant, required double fontSize, required FontWeight weight, required Color background, required Color textColor, required double radius, required List<
EngageAction> actions, required bool isPrimary, bool isDestructive = false, bool applyDestructiveStyling = true, ConfirmDialogConfig confirmDialog = const ConfirmDialogConfig()}) -
const
Properties
-
actions
→ List<
EngageAction> -
Ordered actions to run on tap (may be empty). Run by EngageActionRunner.
final
- applyDestructiveStyling → bool
-
When isDestructive and this is true, the button's rendered background
and text colour are overridden to a fixed danger colour regardless of
background/textColor. Ignored when isDestructive is false.
final
- background → Color
-
final
- box → NudgeBox
-
finalinherited
- confirmDialog → ConfirmDialogConfig
-
Content of the confirmation dialog shown when isDestructive. Always
present (with defaults applied at parse time) even for non-destructive
buttons, since it is simply unused in that case.
final
- fontSize → double
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDestructive → bool
-
When true, tapping this button must show a confirmation dialog before
actions run; the tap is a no-op if the user cancels.
final
- isPrimary → bool
-
Marks this as the experience's primary call-to-action, distinguishing the
emitted click (
cta_primaryvscta_secondary). A button tap emits anExperienceClickedevent only after its actions run successfully; a button with no actions, or one whose action throws, emits nothing.final - label → String
-
final
- radius → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textColor → Color
-
final
- variant → NudgeButtonVariant
-
final
- weight → FontWeight
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited