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) {
  TextAlign? textAlign;
  var textAlignParse = namedArguments[const Symbol('textAlign')];
  if (textAlignParse != null) {
    textAlign = textAlignParse as TextAlign;
  }
  var style = namedArguments[const Symbol('style')];
  if (style == null) {
    throw "DefaultTextStyle must have a style";
  }
  var child = namedArguments[const Symbol('child')];
  if (child == null) {
    throw "DefaultTextStyle must have a child";
  }
  bool softWrap = true;
  var softWrapParsed = namedArguments[const Symbol('softWrap')];
  if (softWrapParsed != null) {
    softWrap = softWrapParsed as bool;
  }
  TextOverflow overflow = TextOverflow.clip;
  var overflowParsed = namedArguments[const Symbol('overflow')];
  if (overflowParsed != null) {
    overflow = overflowParsed as TextOverflow;
  }
  int? maxLines;
  var maxLinesParsed = namedArguments[const Symbol('maxLines')];
  if (maxLinesParsed != null) {
    maxLines = maxLinesParsed as int;
  }
  return DefaultTextStyle(
      style: style as TextStyle,
      child: child as Widget,
      textAlign: textAlign,
      softWrap: softWrap,
      overflow: overflow,
      maxLines: maxLines);
}