The PlGrid is a grid view for showing data in a table with a sticky header and pagination components.
Getting Started #
To add the grid on your project, install it by adding the pl_grid package dependency to your pubspec.yaml file, then import the PlGrid class like so:
Add the widget like in the example down below:
PlGrid( headerColumns: ['Id', 'Name', 'Age'], data: [ [1, 'Bruno', 34], [2, 'Lindsey', 39], [3, 'Roberto', 18], [4, 'Yasmin', 22] ], columnWidthsPercentages: [15, 70, 15], curPage: 1, maxPages: 4, width: 300, height: 200, )
and it will produce the following:
One can also use other parameters for example paginationItemClick that is a function that receives the index of the page touched/clicked to execute any routine such as call api with next page results
The property asCard is set as default to true, but could be set to false, producing the following:
[0.0.1] - TODO: Add release date. #
- TODO: Describe initial release.
[0.0.1+1] - Marks some parameters as @required #
- Some parameters that are mandatory were annotated accordingly
[0.0.0+2] - Adds image to documentation #
Other documentation improvements
[0.0.0+4] - Adds MIT License info #
[0.0.1+0] - Adds lots of customization possibilities to have control of each cell #
Makes it also possible to render Widgets on any cell
import 'package:flutter/material.dart'; import 'package:pl_grid/pl_grid.dart'; void main() => runApp( MaterialApp( home: Scaffold( body: PlGrid( headerColumns: ['Id', 'Name', 'Age'], data: [ [1, 'Bruno', 34], [2, 'Lindsey', 39], [3, 'Roberto', 18], [4, 'Yasmin', 22] ], columnWidthsPercentages: <double>[15, 70, 15], curPage: 1, maxPages: 4, ), ), ), );
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: pl_grid: ^0.0.2+0
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on May 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.8.1
- pana: 0.13.8-dev
- Flutter: 1.17.0
Package is pre-v0.1 release. (-10 points)
While nothing is inherently wrong with versions of
0.0.*, it might mean that the author is still experimenting with the general direction of the API.