call method
Implementation
@override
Object? call(Interpreter interpreter, List<Object?> arguments,
Map<Symbol, Object?> namedArguments) {
Stream? stream;
var streamParsed = namedArguments[const Symbol('stream')];
if (streamParsed != null) {
stream = streamParsed as Stream;
}
var builder = namedArguments[const Symbol('builder')];
if (builder == null) {
throw "builder required in StreamBuilder";
}
var initialData = namedArguments[const Symbol('initialData')];
return StreamBuilder(
stream: stream,
initialData: initialData,
builder: (context, snapshot) {
return (builder as LoxFunction).call(
interpreter, [context, AsyncSnapshotIns(snapshot)], {}) as Widget;
},
);
}