Publish pagination

This commit is contained in:
thomashii 2021-06-26 19:55:17 +08:00
parent 5dbc9b5044
commit 16be2e8f94
7 changed files with 32 additions and 32 deletions

View file

@ -1,5 +1,9 @@
# 3.0.0
# Change Log
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD
# 2.0.0
## 2.0.0
* Dart2 + Angel2 update.

View file

@ -1,19 +1,24 @@
# paginate
[![Pub](https://img.shields.io/pub/v/angel_paginate.svg)](https://pub.dartlang.org/packages/angel_paginate)
[![build status](https://travis-ci.org/angel-dart/paginate.svg)](https://travis-ci.org/angel-dart/paginate)
# Paginate
Platform-agnostic pagination library, with custom support for the
[Angel framework](https://github.com/angel-dart/angel).
[![version](https://img.shields.io/badge/pub-v3.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_paginate)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/paginate/LICENSE)
Platform-agnostic pagination library, with custom support for the [Angel3 framework](https://github.com/dukefirehawk/angel).
## Installation
# Installation
In your `pubspec.yaml` file:
```yaml
dependencies:
angel_paginate: ^2.0.0
angel3_paginate: ^3.0.0
```
# Usage
## Usage
This library exports a `Paginator<T>`, which can be used to efficiently produce
instances of `PaginationResult<T>`. Pagination results, when serialized to JSON, look like
this:
@ -37,9 +42,9 @@ serialized via their `toJson()` method.
To create a paginator:
```dart
import 'package:angel_paginate/angel_paginate.dart';
import 'package:angel3_paginate/angel3_paginate.dart';
main() {
void main() {
var p = new Paginator(iterable);
// Get the current page (default: page 1)
@ -57,4 +62,4 @@ The entire Paginator API is documented, so check out the DartDocs.
Paginators by default cache paginations, to improve performance as you shift through pages.
This can be especially helpful in a client-side application where your UX involves a fast
response time, i.e. a search page.
response time, i.e. a search page.

View file

@ -1,4 +1,4 @@
import 'package:angel_paginate/angel_paginate.dart';
import 'package:angel3_paginate/angel3_paginate.dart';
void main() {
var iterable = [1, 2, 3, 4];

View file

@ -1,22 +1,13 @@
name: angel_paginate
name: angel3_paginate
version: 3.0.0
description: Platform-agnostic pagination library, with custom support for the Angel framework.
homepage: https://github.com/angel-dart/paginate
publish_to: none
description: Platform-agnostic pagination library, with custom support for the Angel3 framework.
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/paginate
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
angel_framework:
git:
url: https://github.com/dukefirehawk/angel.git
ref: sdk-2.12.x_nnbd
path: packages/framework
angel3_framework: ^4.0.0
dev_dependencies:
angel_test:
git:
url: https://github.com/dukefirehawk/angel.git
ref: sdk-2.12.x_nnbd
path: packages/test
angel3_test: ^4.0.0
logging: ^1.0.1
test: ^1.17.8
pedantic: ^1.11.1

View file

@ -1,7 +1,7 @@
import 'dart:convert';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_paginate/angel_paginate.dart';
import 'package:angel_test/angel_test.dart';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_paginate/angel3_paginate.dart';
import 'package:angel3_test/angel3_test.dart';
import 'package:logging/logging.dart';
import 'package:test/test.dart';

View file

@ -1,4 +1,4 @@
import 'package:angel_paginate/angel_paginate.dart';
import 'package:angel3_paginate/angel3_paginate.dart';
import 'package:test/test.dart';
// Count-down from 100, then 101 at the end...