Message.line constructor

Message.line(
  1. String line
)

Implementation

Message.line(String line) {
  var idx = line.indexOf('=');

  _key = line.substring(0, idx).trim();

  var valStr = line.substring(idx + 1);

  var idx2 = valStr.lastIndexOf('##');

  String? description;
  if (idx2 > 0) {
    var desc = valStr.substring(idx2 + 2).trim();
    valStr = valStr.substring(0, idx2);

    if (desc.isNotEmpty) {
      description = desc;
    }
  }

  _value = MessageValue(valStr.trim());
  _description = description;
}