write method

  1. @override
void write(
  1. BinaryWriter writer,
  2. NotificationPriority? obj
)
override

Is called when a value has to be encoded.

Implementation

@override
void write(BinaryWriter writer, NotificationPriority? obj) {
  switch (obj) {
    case NotificationPriority.dummy:
      writer.writeByte(0);
      break;
    case NotificationPriority.low:
      writer.writeByte(1);
      break;
    case NotificationPriority.medium:
      writer.writeByte(2);
      break;
    case NotificationPriority.high:
      writer.writeByte(3);
      break;
    default:
      break;
  }
}