update method

  1. @override
(PaginatorModel, Cmd?) update(
  1. Msg msg
)
override

Updates the component state in response to a message.

Returns the updated component (often this) and an optional command.

Implementation

@override
(PaginatorModel, Cmd?) update(Msg msg) {
  if (msg is KeyMsg) {
    if (msg.matches([keyMap.nextPage])) {
      return (nextPage(), null);
    }
    if (msg.matches([keyMap.prevPage])) {
      return (prevPage(), null);
    }
  }
  return (this, null);
}