withSFSymbol static method
Create a BottomNavigationBarItem with SF Symbol metadata for native iOS tab bars
Implementation
static BottomNavigationBarItem withSFSymbol({
required Widget icon,
required String sfSymbolName,
String? label,
Widget? activeIcon,
String? tooltip,
Color? backgroundColor,
}) {
// Wrap the icon with a key containing the SF Symbol name
final Widget keyedIcon = KeyedSubtree(
key: BaseNativeTabBarItemKey(sfSymbolName),
child: icon,
);
return BottomNavigationBarItem(
icon: keyedIcon,
activeIcon: activeIcon,
label: label,
tooltip: tooltip,
backgroundColor: backgroundColor,
);
}