begin method

  1. @override
void begin(
  1. TagContext tc,
  2. String data
)
override

Called when the beginning of a tag is encountered.

Implementation

@override
void begin(TagContext tc, String data) {
  final argInfo = ArgInfo(tc, data, stringFirst: false);
  final parentArgs = tc.parent?.args;
  var var1 = parentArgs != null ?
        (parentArgs[argInfo.first] = tc.nextVar()): argInfo.first,
    var2 = tc.nextVar();
  tc..push(var1)..push(var2);

  if (tc.parent?.args == null) var1 = "_${var1}_";
  tc.writeln("\n${tc.pre}final $var1 = StringBuffer(), $var2 = connect;${tc.getLineNumberComment()}\n"
    "${tc.pre}connect = HttpConnect.stringBuffer(connect, $var1); response = connect.response;");
}