UIPaging class

A class that handles pagination logic and generates view parameters for rendering.

The UIPaging class is used to manage pagination, including calculating the current page, the range of pages to display, and handling query parameters. It extends WaView to integrate with the application's view rendering system.

Inheritance

Constructors

UIPaging({required WebRequest rq, required String widget, Map<String, Object?> params = const {}, required int page, required int total, int pageSize = 20, String profix = 'page', Map<String, String> otherQuery = const <String, String>{}, int widthSide = 2, bool useRequsetQueries = false, String orderBy = '', bool orderReverse = false})
Creates a new UIPaging instance.
UIPaging.fromRequest(WebRequest rq, {required int total, String profix = 'page', String widget = 'dashboard/theme/ui/paging', Map<String, String> otherQuery = const {}, int pageSize = 5, String orderByDef = '', bool orderReverseDef = false, int pageDef = 1})
A factory constructor to create UIPaging from a request object rq.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
orderBy String
The column or field used for ordering the items.
getter/setter pair
orderReverse bool
Whether the ordering should be in reverse (descending).
getter/setter pair
otherQuery Map<String, String>
Additional query parameters to include in the pagination URLs.
getter/setter pair
page int
The current page number.
getter/setter pair
pageSize int
The number of items per page. Defaults to 20.
getter/setter pair
params Map<String, Object?>
A map containing parameters that can be passed to the view for rendering.
getter/setter pairinherited
profix String
The query parameter used to identify the page number in URLs. Defaults to 'page'.
getter/setter pair
rq WebRequest
The WebRequest object representing the current request.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start int
Calculates the starting index for the current page based on page and pageSize.
no setter
total int
The total number of items.
getter/setter pair
useRequsetQueries bool
Whether to use query parameters from the request object.
getter/setter pair
widget String
The path to the widget or view template.
getter/setter pairinherited
widthSide int
The number of pages displayed on either side of the current page.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render({dynamic toData = false}) Future<Object>
Renders the view.
inherited
renderData() Future<Map<String, Object?>>
Generates and returns a map of data for rendering the pagination UI.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited