BankDeviceTrustBanner class
A contextual security banner driven by an externally-supplied state flag.
- BankDeviceTrustState.newDevice: amber left-border banner with an info
icon, using BankTokens.warning (
#FF9500) as the accent colour. - BankDeviceTrustState.compromised: red left-border banner with a shield icon, using BankTokens.danger as the accent colour.
The banner reads its localised strings from strings when provided, or
falls back to the ambient BankUiScope strings. The whole widget is
annotated as a liveRegion so assistive technology announces the message
when it appears.
BankDeviceTrustBanner(
state: BankDeviceTrustState.newDevice,
onDismiss: () => setState(() => _showBanner = false),
onLearnMore: () => launchUrl(securityHelpUri),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BankDeviceTrustBanner
Constructors
- BankDeviceTrustBanner({required BankDeviceTrustState state, Key? key, VoidCallback? onDismiss, VoidCallback? onLearnMore, BankUiStrings? strings, EdgeInsetsGeometry? padding, BorderRadius? radius, Color? backgroundColor, Color? accentColor, IconData? icon, IconData? dismissIcon, TextStyle? titleStyle, TextStyle? bodyStyle, String learnMoreLabel = 'Learn more', String dismissSemanticLabel = 'Dismiss security notice'})
-
const
Properties
- accentColor → Color?
-
Overrides the state accent (left border, icon, learn-more link).
Defaults to BankTokens.warning or BankTokens.danger per state.
final
- backgroundColor → Color?
-
Overrides the banner background. Defaults to
BankThemeData.surfaceVariant.
final
- bodyStyle → TextStyle?
-
Merged over the computed body style (BankTokens.bodySmall).
final
- dismissIcon → IconData?
-
Overrides the dismiss glyph. Defaults to BankIcons.close.
final
- dismissSemanticLabel → String
-
Semantics label of the dismiss button. Defaults to
'Dismiss security notice'.final - hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
Overrides the leading glyph. Defaults to the state-appropriate
BankIcons glyph.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- learnMoreLabel → String
-
Label of the learn-more link. Defaults to
'Learn more'.final - onDismiss → VoidCallback?
-
When non-null, an
×dismiss button is shown on the trailing edge.final - onLearnMore → VoidCallback?
-
When non-null, a "Learn more" text button is shown below the body text.
final
- padding → EdgeInsetsGeometry?
-
Overrides the banner content padding. Defaults to BankTokens.space4
horizontal, BankTokens.space3 vertical.
final
- radius → BorderRadius?
-
Overrides the banner corner radius. Defaults to
BankThemeData.cardRadius.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → BankDeviceTrustState
-
The security classification that determines copy, colour, and icon.
final
- strings → BankUiStrings?
-
Optional override for localised strings. Falls back to
BankUiScope.of(context).strings when null.
final
- titleStyle → TextStyle?
-
Merged over the computed title style (BankTokens.labelLarge).
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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