IconTab constructor
const
IconTab({
- Key? key,
- required IconData icon,
- IconData? selectedIcon,
- String? label,
- VoidCallback? onPressed,
Creates an IconTab for use in a ButtonBar.
The icon parameter is required and specifies the base icon for the tab,
which displays in the unselected state and falls back for selected if selectedIcon
is not provided. The selectedIcon allows customization of the highlighted appearance.
The label provides semantic information for screen readers, enhancing accessibility
in compliance with Arcane's inclusive design principles. The onPressed callback
enables navigation or state updates, typically integrating with a parent ButtonBar's
selection logic to switch between app sections.
Example usage within a ButtonBar:
IconTab(
icon: Icons.home,
selectedIcon: Icons.home_outlined,
label: 'Home',
onPressed: () => _navigateToHome(),
)
This constructor initializes the widget as const for performance optimization in Flutter's widget tree.
Implementation
const IconTab(
{super.key,
required this.icon,
this.selectedIcon,
this.label,
this.onPressed});