BankAlertPreferencesPanel class
Per-event, per-channel alert preference matrix for the notification settings screen.
Rows group into Security & fraud / Payments / Account activity / Marketing sections with the security section pinned first. Locked (compliance) rows render their switches on and disabled. Changes fire onChanged immediately: hosts debounce persistence.
BankAlertPreferencesPanel(
preferences: prefs,
onChanged: (type, channel, enabled) =>
api.setAlertPref(type, channel, enabled),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BankAlertPreferencesPanel
Constructors
-
BankAlertPreferencesPanel({required List<
BankAlertPreference> preferences, required void onChanged(BankNotificationType type, BankAlertChannel channel, bool enabled), Key? key, Set<BankAlertChannel> availableChannels = const {BankAlertChannel.push, BankAlertChannel.email}, Widget? header, String requiredLabel = 'Required', Map<BankAlertSection, String> sectionLabels = const {BankAlertSection.security : 'Security & fraud', BankAlertSection.payments : 'Payments', BankAlertSection.account : 'Account activity', BankAlertSection.marketing : 'Marketing'}, Map<BankAlertChannel, String> channelLabels = const {BankAlertChannel.push : 'Push', BankAlertChannel.email : 'Email', BankAlertChannel.sms : 'SMS'}, Map<BankNotificationType, String> typeLabels = const {}, EdgeInsetsGeometry? sectionHeaderPadding, EdgeInsetsGeometry? rowPadding, Color? accentColor, Color? switchThumbColor, Color? iconColor, TextStyle? sectionLabelStyle, TextStyle? channelLabelStyle, TextStyle? titleStyle, TextStyle? requiredLabelStyle, Map<BankNotificationType, IconData> typeIcons = const {}, IconData? securityIcon, IconData? lockIcon, double? channelColumnWidth, String? semanticLabel}) -
const
Properties
- accentColor → Color?
-
Overrides the accent used for the security header icon and the switch
active track. Defaults to the theme primary.
final
-
availableChannels
→ Set<
BankAlertChannel> -
Which channel columns to render.
final
- channelColumnWidth → double?
-
Overrides the width of each channel column. Defaults to
56.final -
channelLabels
→ Map<
BankAlertChannel, String> -
final
- channelLabelStyle → TextStyle?
-
Merged over the channel column header style
(BankTokens.labelSmall in onSurfaceVariant).
final
-
Optional slot below the matrix. Defaults to no footer.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
Optional slot above the matrix.
final
- iconColor → Color?
-
Overrides the per-row type icon and lock icon color. Defaults to the
theme onSurfaceVariant.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lockIcon → IconData?
-
Overrides the locked row icon. Defaults to
BankIcons.lock.final - onChanged → void Function(BankNotificationType type, BankAlertChannel channel, bool enabled)
-
Fired immediately on every switch flip.
final
-
preferences
→ List<
BankAlertPreference> -
final
- requiredLabel → String
-
Helper shown on locked rows.
final
- requiredLabelStyle → TextStyle?
-
Merged over the locked helper label style
(BankTokens.labelSmall in onSurfaceVariant).
final
- rowPadding → EdgeInsetsGeometry?
-
Overrides each preference row padding. Defaults to
EdgeInsets.symmetric(horizontal: space4, vertical: space1).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sectionHeaderPadding → EdgeInsetsGeometry?
-
Overrides the section header padding. Defaults to
EdgeInsets.fromLTRB(space4, space5, space4, space2).final -
sectionLabels
→ Map<
BankAlertSection, String> -
final
- sectionLabelStyle → TextStyle?
-
Merged over the section label style
(BankTokens.labelMedium in onSurfaceVariant).
final
- securityIcon → IconData?
-
Overrides the security section header icon. Defaults to
BankIcons.shield.final - semanticLabel → String?
-
When non-null, wraps the panel in a Semantics label. Defaults to no
extra semantics node.
final
- switchThumbColor → Color?
-
Overrides the switch thumb color when on. Defaults to the theme
onPrimary.
final
- titleStyle → TextStyle?
-
Merged over the row title style
(BankTokens.bodyLarge in onSurface).
final
-
typeIcons
→ Map<
BankNotificationType, IconData> -
Overrides the per-type icon glyphs. Missing entries fall back to the
built-in defaults.
final
-
typeLabels
→ Map<
BankNotificationType, String> -
Overrides the default English labels per notification type.
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