propertyListWithString static method

Object propertyListWithString(
  1. String string
)

Creates and returns a property list from the specified xml String. Equivalent to iOS method [NSPropertyList propertyListWithData:options:format:error]

The string parameter must be a String of xml plist.

Returns one of String, int, double, Map<String, Object>, List, DateTime, bool or ByteData.

Hint: To convert any returned ByteData objects into a Uint8List, you should use the following pattern:

data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);

Throws PropertyListReadStreamException if the plist is corrupt, values could not be converted or the input stream is EOF.

Implementation

static Object propertyListWithString(String string) {
  try {
    final p = XMLPropertyListReader(string);
    return p.parse();
  } catch (e, s) {
    print(s);
    throw PropertyListReadStreamException.nested(e);
  }
}