ComponentPaginationBase class Null safety
Base class for custom interaction paginator. getMessageBuilderForPage needs to be implemented in order to work.
- Inheritance
-
- Object
- IPagination<
IButtonInteractionEvent, ComponentMessageBuilder> - ComponentPaginationAbstract
- ComponentPaginationBase
- Implementers
Constructors
- ComponentPaginationBase(IInteractions interactions, {String firstLabel = '<<', String prevLabel = '<', String nextLabel = '>', String lastLabel = '>>', IEmoji? firstEmoji, IEmoji? prevEmoji, IEmoji? nextEmoji, IEmoji? lastEmoji, Duration? timeout, IUser? user})
- Creates instance of ComponentPaginationBase
Properties
- builder ↔ ComponentMessageBuilder
-
Message builder used to create paginated messages
read / writeinherited
- currentPage ↔ int
-
Current page that paginator is on
read / writeinherited
- customPreId ↔ String
-
Custom id for this instance of paginator that different paginators could be recognized.
latefinalinherited
- firstEmoji → IEmoji?
-
finalinherited
- firstLabel → String
-
finalinherited
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- interactions → IInteractions
-
Reference to
Interactions
finalinherited - lastEmoji → IEmoji?
-
finalinherited
- lastLabel → String
-
finalinherited
- maxPage → int
-
Number of pages
read-onlyinherited
- message ↔ IMessage?
-
read / writeinherited
- nextEmoji → IEmoji?
-
finalinherited
- nextLabel → String
-
finalinherited
- prevEmoji → IEmoji?
-
finalinherited
- prevLabel → String
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- timeout → Duration?
-
A timeout after which pagination will be disabled for this message.
finalinherited
- user → IUser?
-
The user that can use the pagination.
finalinherited
Methods
-
getMessageBuilderForPage(
int page, ComponentMessageBuilder currentBuilder) → ComponentMessageBuilder -
Returns MessageBuilder for
page
number. Always modify builder passed incurrentBuilder
argument.inherited -
initHook(
ComponentMessageBuilder builder) → ComponentMessageBuilder -
Called after initializing basic components.
inherited
-
initMessageBuilder(
) → ComponentMessageBuilder -
Inits ComponentMessageBuilder with buttons needed for pagination. And hooks needed events.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
onFirstPageButtonClicked(
) → void -
Invoked on first page button click
inherited
-
onLastPageButtonClicked(
) → void -
Invoked when last page button is clicked.
inherited
-
onNextPageButtonClicked(
) → void -
Invoked when next page button is clicked.
inherited
-
onPreviousPageButtonClicked(
) → void -
Invoked when previous page button is clicked.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updatePage(
int page, ComponentMessageBuilder currentBuilder, IButtonInteractionEvent target) → FutureOr< void> -
Invoked on each page update. Current page number is passed in
page
argument. Builder that message should be edited with is passed incurrentBuilder
argument.target
parameter is generic and allows customization of how message will be modified.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited