BankBeneficiaryPicker class
Saved-beneficiaries list with search and an add-new entry point.
Displays a search bar at the top, followed by an optional "Add new beneficiary" row (when onAddNew is non-null), then a filtered list of BankBeneficiary rows. The selected beneficiary is highlighted with a trailing checkmark.
Provide itemBuilder to completely replace the default row layout for each beneficiary while retaining the built-in search, filtering, and add-new logic.
BankBeneficiaryPicker(
beneficiaries: savedBeneficiaries,
selectedId: _selectedId,
onSelected: (b) => setState(() => _selected = b),
onAddNew: () => Navigator.push(context, AddBeneficiaryRoute()),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BankBeneficiaryPicker
Constructors
-
BankBeneficiaryPicker({required List<
BankBeneficiary> beneficiaries, required ValueChanged<BankBeneficiary> onSelected, Key? key, String? selectedId, VoidCallback? onAddNew, Widget itemBuilder(BuildContext, BankBeneficiary, bool isSelected)?, String searchHint = 'Search beneficiaries', String clearSearchLabel = 'Clear search', String addNewLabel = 'Add new beneficiary', Color? searchFillColor, BorderRadius? searchRadius, EdgeInsetsGeometry? listPadding, TextStyle? titleStyle, TextStyle? subtitleStyle, IconData? searchIcon, IconData? clearIcon, IconData? addIcon, IconData? verifiedIcon, IconData? selectedIcon, Color? accentColor}) -
const
Properties
- accentColor → Color?
-
Overrides the accent used for the add-new row, focused search border,
verified badge, selection checkmark, and avatar fallback. Defaults to
the theme primary.
final
- addIcon → IconData?
-
Overrides the add-new row glyph. Defaults to BankIcons.add.
final
- addNewLabel → String
-
Text of the add-new row. Defaults to
'Add new beneficiary'.final -
beneficiaries
→ List<
BankBeneficiary> -
Full list of beneficiaries to display before any search query is applied.
final
- clearIcon → IconData?
-
Overrides the clear-search glyph. Defaults to BankIcons.close.
final
- clearSearchLabel → String
-
Tooltip of the clear-search button. Defaults to
'Clear search'.final - hashCode → int
-
The hash code for this object.
no setterinherited
- itemBuilder → Widget Function(BuildContext, BankBeneficiary, bool isSelected)?
-
Optional builder for individual beneficiary rows. When provided, it
completely replaces the default row for each BankBeneficiary. The
isSelectedflag indicates whether this beneficiary is the currently selected one.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listPadding → EdgeInsetsGeometry?
-
Overrides the list padding. Defaults to
EdgeInsets.only(bottom: BankTokens.space4).final - onAddNew → VoidCallback?
-
When non-null, an "Add new beneficiary" row is shown at the top of the
list. The host app is responsible for the add-new navigation flow.
final
-
onSelected
→ ValueChanged<
BankBeneficiary> -
Called when the user taps a beneficiary row.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchFillColor → Color?
-
Overrides the search field fill color. Defaults to the theme
surfaceVariant.
final
- searchHint → String
-
Hint text inside the search field. Defaults to
'Search beneficiaries'.final - searchIcon → IconData?
-
Overrides the search field prefix glyph. Defaults to
BankIcons.search.
final
- searchRadius → BorderRadius?
-
Overrides the search field corner radius. Defaults to the theme
chipRadius.
final
- selectedIcon → IconData?
-
Overrides the selected-row checkmark glyph. Defaults to
Icons.check_circle.
final
- selectedId → String?
-
The BankBeneficiary.id of the currently selected beneficiary, or
nullif none is selected.final - subtitleStyle → TextStyle?
-
Merged over the account details style
(BankTokens.bodySmall in onSurfaceVariant).
final
- titleStyle → TextStyle?
-
Merged over the beneficiary name style
(BankTokens.bodyLarge in onSurface, w500).
final
- verifiedIcon → IconData?
-
Overrides the verified-beneficiary glyph. Defaults to
Icons.verified_outlined.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BankBeneficiaryPicker> -
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