BankConsentModal class

Scrollable terms-acknowledgement modal.

The primary "Accept" action is gated behind two conditions:

  1. The user has scrolled to the bottom of the terms content.
  2. The user has explicitly checked the acknowledgement checkbox.

Use BankConsentModal.show to display this as a Dialog.

Inheritance

Constructors

BankConsentModal({required String title, required String termsContent, required VoidCallback onAccept, required VoidCallback onDecline, Key? key, Widget? richTermsContent, String checkboxLabel = 'I have read and agree to the terms above', String acceptLabel = 'Accept', String declineLabel = 'Decline', String scrollHintLabel = 'Scroll to read all terms', IconData? scrollHintIcon, TextStyle? titleStyle, TextStyle? termsStyle, TextStyle? checkboxLabelStyle, BorderRadius? radius, double? maxWidth, Color? accentColor, Duration? animationDuration})
const

Properties

accentColor Color?
Active checkbox color. Defaults to the theme primary.
final
acceptLabel String
Label for the accept button.
final
animationDuration Duration?
Duration of the scroll hint fade. Defaults to BankTokens.durationFast.
final
checkboxLabel String
Checkbox label. Disabled until the user has scrolled to the bottom.
final
checkboxLabelStyle TextStyle?
Merged over the computed checkbox label style (bodySmall).
final
declineLabel String
Label for the decline button.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxWidth double?
Maximum modal width. Defaults to 560.
final
onAccept VoidCallback
Called when the user taps the Accept button (requires checkbox checked).
final
onDecline VoidCallback
Called when the user taps the Decline button.
final
radius BorderRadius?
Corner radius of the modal. Defaults to the theme cardRadius.
final
richTermsContent Widget?
If provided, used instead of termsContent: allows the host app to pass rich widgets (e.g. rendered Markdown).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollHintIcon IconData?
Glyph next to the scroll hint. Defaults to Icons.keyboard_arrow_down_rounded.
final
scrollHintLabel String
Hint shown until the user reaches the bottom of the terms. Defaults to 'Scroll to read all terms'.
final
termsContent String
Plain-text terms content. Used when richTermsContent is null.
final
termsStyle TextStyle?
Merged over the computed terms body style (bodyMedium).
final
title String
Modal title, shown in headlineSmall.
final
titleStyle TextStyle?
Merged over the computed title style (headlineSmall).
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<BankConsentModal>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

show(BuildContext context, {required String title, required String termsContent, required VoidCallback onAccept, required VoidCallback onDecline, Widget? richContent}) Future<bool?>
Shows BankConsentModal in a Dialog and returns true if accepted, false if declined, or null if dismissed without an action.