copyWith method
Apply updates to a copy of this message.
Makes a writable shallow copy of this message, applies the updates to
it, and marks the copy read-only before returning it.
Implementation
Payload copyWith(void Function(Payload) updates) =>
super.copyWith((message) => updates(message as Payload)) as Payload;