call method

  1. @override
Object? call(
  1. Interpreter interpreter,
  2. List<Object?> arguments,
  3. Map<Symbol, Object?> namedArguments
)
override

Implementation

@override
Object? call(Interpreter interpreter, List<Object?> arguments,
    Map<Symbol, Object?> namedArguments) {
  var icon = namedArguments[const Symbol('icon')];
  if (icon == null) {
    throw "icon required in BottomNavigationBarItem";
  }
  String? label;
  var labelParsed = namedArguments[const Symbol('label')];
  if (labelParsed != null) {
    label = labelParsed as String;
  }
  String? tooltip;
  var tooltipParsed = namedArguments[const Symbol('tooltip')];
  if (tooltipParsed != null) {
    tooltip = tooltipParsed as String;
  }
  Color? backgroundColor;
  var backgroundColorParsed = namedArguments[const Symbol('backgroundColor')];
  if (backgroundColorParsed != null) {
    backgroundColor = backgroundColorParsed as Color;
  }
  Widget? activeIcon;
  var activeIconParsed = namedArguments[const Symbol('activeIcon')];
  if (activeIconParsed != null) {
    activeIcon = activeIconParsed as Widget;
  }
  return BottomNavigationBarItem(
    icon: icon as Widget,
    label: label,
    activeIcon: activeIcon,
    tooltip: tooltip,
    backgroundColor: backgroundColor,
  );
}