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) {
  List<BottomNavigationBarItem> items = [];
  var itemsParsed = namedArguments[const Symbol('items')];
  if (itemsParsed != null) {
    items = (itemsParsed as List).cast<BottomNavigationBarItem>();
  }
  int currentIndex = 0;
  var currentIndexParsed = namedArguments[const Symbol('currentIndex')];
  if (currentIndexParsed != null) {
    currentIndex = currentIndexParsed as int;
  }
  double? elevation = parseDouble(namedArguments[const Symbol('elevation')]);
  double iconSize =
      parseDouble(namedArguments[const Symbol('fontSize')]) ?? 22.0;
  Color? selectedItemColor;
  var selectedItemColorParsed =
      namedArguments[const Symbol('selectedItemColor')];
  if (selectedItemColorParsed != null) {
    selectedItemColor = selectedItemColorParsed as Color;
  }
  Color? unselectedItemColor;
  var unselectedItemColorParsed =
      namedArguments[const Symbol('unselectedItemColor')];
  if (unselectedItemColorParsed != null) {
    unselectedItemColor = unselectedItemColorParsed as Color;
  }
  double selectedFontSize =
      parseDouble(namedArguments[const Symbol('selectedFontSize')]) ?? 14.0;
  double unselectedFontSize =
      parseDouble(namedArguments[const Symbol('unselectedFontSize')]) ?? 12.0;
  bool? showSelectedLabels;
  var showSelectedLabelsParsed =
      namedArguments[const Symbol('showSelectedLabels')];
  if (showSelectedLabelsParsed != null) {
    showSelectedLabels = showSelectedLabelsParsed as bool;
  }
  bool? showUnselectedLabels;
  var showUnselectedLabelsParsed =
      namedArguments[const Symbol('showUnselectedLabels')];
  if (showUnselectedLabelsParsed != null) {
    showUnselectedLabels = showUnselectedLabelsParsed as bool;
  }
  Function(int)? onTap;
  var onTapParsed = namedArguments[const Symbol('onTap')];
  if (onTapParsed != null) {
    onTap = (int i) {
      (onTapParsed as LoxFunction).call(interpreter, [i], {});
    };
  }
  Color? fixedColor;
  var fixedColorParsed = namedArguments[const Symbol('fixedColor')];
  if (fixedColorParsed != null) {
    fixedColor = fixedColorParsed as Color;
  }
  Color? backgroundColor;
  var backgroundColorParsed = namedArguments[const Symbol('backgroundColor')];
  if (backgroundColorParsed != null) {
    backgroundColor = backgroundColorParsed as Color;
  }
  TextStyle? selectedLabelStyle;
  var selectedLabelStyleParsed =
      namedArguments[const Symbol('selectedLabelStyle')];
  if (selectedLabelStyleParsed != null) {
    selectedLabelStyle = selectedLabelStyleParsed as TextStyle;
  }
  TextStyle? unselectedLabelStyle;
  var unselectedLabelStyleParsed =
      namedArguments[const Symbol('unselectedLabelStyle')];
  if (unselectedLabelStyleParsed != null) {
    unselectedLabelStyle = unselectedLabelStyleParsed as TextStyle;
  }
  return BottomNavigationBar(
    items: items,
    onTap: onTap,
    currentIndex: currentIndex,
    iconSize: iconSize,
    elevation: elevation,
    fixedColor: fixedColor,
    backgroundColor: backgroundColor,
    selectedItemColor: selectedItemColor,
    unselectedItemColor: unselectedItemColor,
    selectedFontSize: selectedFontSize,
    unselectedFontSize: unselectedFontSize,
    selectedLabelStyle: selectedLabelStyle,
    unselectedLabelStyle: unselectedLabelStyle,
    showSelectedLabels: showSelectedLabels,
    showUnselectedLabels: showUnselectedLabels,
  );
}