Message constructor

const Message(
  1. String text,
  2. DateTime timestamp,
  3. Person person,
  4. {String dataMimeType,
  5. String dataUri}
)

Constructs an instance of Message.

Implementation

const Message(
  this.text,
  this.timestamp,
  this.person, {
  this.dataMimeType,
  this.dataUri,
})  : assert(
        timestamp != null,
        'timestamp must be provided',
      ),
      assert(
        (dataMimeType == null && dataUri == null) ||
            (dataMimeType != null && dataUri != null),
        'Must provide both dataMimeType and dataUri together or not at all.',
      );