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<Widget> tabs = [];
  var tabsParsed = namedArguments[const Symbol('tabs')];
  if (tabsParsed != null) {
    tabs = (tabsParsed as List).cast<Widget>();
  }
  bool isScrollable = false;
  var isScrollableParsed = namedArguments[const Symbol('isScrollable')];
  if (isScrollableParsed != null) {
    isScrollable = isScrollableParsed as bool;
  }
  EdgeInsetsGeometry? padding;
  var paddingParsed = namedArguments[const Symbol('padding')];
  if (paddingParsed != null) {
    padding = paddingParsed as EdgeInsetsGeometry;
  }
  Color? labelColor;
  var labelColorParsed = namedArguments[const Symbol('labelColor')];
  if (labelColorParsed != null) {
    labelColor = labelColorParsed as Color;
  }
  Color? unselectedLabelColor;
  var unselectedLabelColorParsed =
      namedArguments[const Symbol('unselectedLabelColor')];
  if (unselectedLabelColorParsed != null) {
    unselectedLabelColor = unselectedLabelColorParsed as Color;
  }
  TextStyle? labelStyle;
  var labelStyleParsed = namedArguments[const Symbol('labelStyle')];
  if (labelStyleParsed != null) {
    labelStyle = labelStyleParsed as TextStyle;
  }
  TextStyle? unselectedLabelStyle;
  var unselectedLabelStyleParsed =
      namedArguments[const Symbol('unselectedLabelStyle')];
  if (unselectedLabelStyleParsed != null) {
    unselectedLabelStyle = unselectedLabelStyleParsed as TextStyle;
  }
  EdgeInsetsGeometry? labelPadding;
  var labelPaddingParsed = namedArguments[const Symbol('padding')];
  if (labelPaddingParsed != null) {
    labelPadding = labelPaddingParsed as EdgeInsetsGeometry;
  }
  Color? indicatorColor;
  var indicatorColorParsed = namedArguments[const Symbol('indicatorColor')];
  if (indicatorColorParsed != null) {
    indicatorColor = indicatorColorParsed as Color;
  }
  double indicatorWeight =
      parseDouble(namedArguments[const Symbol('indicatorWeight')]) ?? 2.0;
  TabBarIndicatorSize? indicatorSize;
  var indicatorSizeParsed = namedArguments[const Symbol('indicatorSize')];
  if (indicatorSizeParsed != null) {
    indicatorSize = indicatorSizeParsed as TabBarIndicatorSize;
  }
  EdgeInsetsGeometry indicatorPadding = EdgeInsets.zero;
  var indicatorPaddingParsed =
      namedArguments[const Symbol('indicatorPadding')];
  if (indicatorPaddingParsed != null) {
    indicatorPadding = indicatorPaddingParsed as EdgeInsetsGeometry;
  }
  Function(int)? onTap;
  var onTapParsed = namedArguments[const Symbol('onTap')];
  if (onTapParsed != null) {
    onTap = (int i) {
      (onTapParsed as LoxFunction).call(interpreter, [i], {});
    };
  }
  bool automaticIndicatorColorAdjustment = true;
  var automaticIndicatorColorAdjustmentParsed =
      namedArguments[const Symbol('automaticIndicatorColorAdjustment')];
  if (automaticIndicatorColorAdjustmentParsed != null) {
    automaticIndicatorColorAdjustment =
        automaticIndicatorColorAdjustmentParsed as bool;
  }
  Decoration? indicator;
  var indicatorParsed = namedArguments[const Symbol('indicator')];
  if (indicatorParsed != null) {
    indicator = indicatorParsed as Decoration;
  }
  return TabBar(
    tabs: tabs,
    onTap: onTap,
    padding: padding,
    indicator: indicator,
    labelPadding: labelPadding,
    labelColor: labelColor,
    labelStyle: labelStyle,
    unselectedLabelColor: unselectedLabelColor,
    unselectedLabelStyle: unselectedLabelStyle,
    automaticIndicatorColorAdjustment: automaticIndicatorColorAdjustment,
    indicatorColor: indicatorColor,
    indicatorWeight: indicatorWeight,
    indicatorPadding: indicatorPadding,
    isScrollable: isScrollable,
    indicatorSize: indicatorSize,
  );
}