================================================
FILE: .metadata
================================================
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 746d5f7676e116041dd125d98ffbeeaf9251b90d
channel: master
project_type: plugin
================================================
FILE: .vscode/launch.json
================================================
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart",
"program": "example/lib/main.dart"
}
]
}
================================================
FILE: .vscode/settings.json
================================================
{
"cSpell.words": [
"datatable",
"listview"
]
}
================================================
FILE: CHANGELOG.md
================================================
## 1.4.0
* fixed deprecated theme properties
## 1.3.2
* fixing hide select box
* recreating example target folders
## 1.3.1
* support for no items
* adding totalItems
## 1.3.0
* adding `showSelect'
* adding `showSort'
## 1.2.0
* Stable Version
* Added '.fromJson'
* Updated Examples
## 1.1.1-nullsafety
* Updating to null safety
## 1.1.0-nullsafety
* Updating to null safety
## 1.0.1 - 04.06.2019
* Fixing Bugs on Mobile
* Added `alwaysShowDataTable`
## 1.0.0 - 04.26.2019
* Adding Desktop to Example
* Requiring `Dart 2.2.2`
* Fixing Sort Fields
* Fixing Bottom Bar
* Fixed Mobile Item Builder
## 0.3.0 - 04.06.2019
* Making Example Desktop Aware
## 0.2.4
* Fixed Padding on Refresh
* Added CupertinoRefreshController
## 0.2.3
* Removing SafeArea
## 0.2.2
* Adding Mobile Slivers
* Updated Example
## 0.2.1
* Updating Toolbar on Mobile
## 0.2.0
* Updating Size Attribute to Detect if Tablet
## 0.1.3
* Adding Size Attribute to Detect if Tablet
## 0.1.2
* Fixing Mobile onSort Behavior
* Fixing Bottom Bar Sizing
## 0.1.1
* Adding Support for Widgets when No Items Loded and Empty Items
## 0.1.0
* Updated Example
* Made Tableview Stateless
* Removed Need for Data Source
## 0.0.2
* Updated Example
* Made Tableview Stateless
* Removed Need for Data Source
## 0.0.1
* Created Data Table
* Created Mobile ListView
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2020 Rody Davis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
[](https://www.buymeacoffee.com/rodydavis)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WSH3GVC49GNNJ)

[](https://github.com/rodydavis/data_tables)
[](https://pub.dev/packages/data_tables)
# data_tables
- Full Screen Paginated Data Tables for Tablets/Desktops
- Mobile ListView with Action Buttons for Sorting and Selecting All
- Supports Dark Mode
- From Json
Online Demo: https://rodydavis.github.io/data_tables/
## Getting Started
- You can optionally build the listview for mobile with a builder, by default it creates a ExpansionTile with the remaining columns as children
- The tablet breakpoint can also be set.
`bool showMobileListView;` - When set to false it will always show a data table
`int sortColumnIndex;` - Current Sorted Column
`bool sortAscending;` - Sort Order
`ValueChanged onSelectAll;` - Called for Selecting and Deselecting All
`ValueChanged onRowsPerPageChanged;` - Called when rows change on data table or last row reached on mobile.
`int rowsPerPage;` - Default Rows per page
`Widget header;` - Widget header for Desktop and Tablet Data Table
`List columns;` - List of Columns (Must match length of DataCells in DataSource)
`IndexedWidgetBuilder mobileItemBuilder;` - Optional Item builder for the list view for Mobile
`Size tabletBreakpoint;` - Tablet breakpoint for the screen width and height
`List actions, selectedActions;` - Actions that show when items are selected or not
`RefreshCallback onRefresh;` - If not null the list view will be wrapped in a RefreshIndicator
## Screenshots





================================================
FILE: analysis_options.yaml
================================================
include: package:pedantic/analysis_options.yaml
analyzer:
exclude:
- lib/**
- pubspec.lock
================================================
FILE: data_tables.iml
================================================
================================================
FILE: example/ios/Flutter/flutter_export_environment.sh
================================================
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/usr/local/Caskroom/flutter/1.2.1/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/rodydavis/Developer/GitHub/plugins/packages/data_tables/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
================================================
FILE: example/linux/flutter/generated_plugin_registrant.cc
================================================
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void fl_register_plugins(FlPluginRegistry* registry) {
}
================================================
FILE: example/linux/flutter/generated_plugin_registrant.h
================================================
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include
// Registers Flutter plugins.
void fl_register_plugins(FlPluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_
================================================
FILE: example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
================================================
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/usr/local/Caskroom/flutter/1.2.1/flutter
FLUTTER_APPLICATION_PATH=/Users/rodydavis/Developer/GitHub/plugins/packages/data_tables/example
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_BUILD_DIR=build
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
EXCLUDED_ARCHS=arm64
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=false
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=.packages
================================================
FILE: example/macos/Flutter/ephemeral/flutter_export_environment.sh
================================================
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/usr/local/Caskroom/flutter/1.2.1/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/rodydavis/Developer/GitHub/plugins/packages/data_tables/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "EXCLUDED_ARCHS=arm64"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
================================================
FILE: example/windows/flutter/generated_plugin_registrant.cc
================================================
//
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
void RegisterPlugins(flutter::PluginRegistry* registry) {
}
================================================
FILE: example/windows/flutter/generated_plugin_registrant.h
================================================
//
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
#include
// Registers Flutter plugins.
void RegisterPlugins(flutter::PluginRegistry* registry);
#endif // GENERATED_PLUGIN_REGISTRANT_
================================================
FILE: lib/data_tables.dart
================================================
import 'package:flutter/material.dart';
import 'ui/mobile_paged_listview.dart';
import 'ui/stateless_datatable.dart';
const _kTabletBreakpoint = Size(480, 480);
class NativeDataTable extends StatelessWidget {
const NativeDataTable({
required this.columns,
required this.rows,
this.rowsPerPage = PaginatedDataTable.defaultRowsPerPage,
this.header,
this.showSelect = true,
this.showSort = true,
this.onRowsPerPageChanged,
this.totalItems,
this.onSelectAll,
this.sortAscending,
this.sortColumnIndex,
this.mobileItemBuilder,
this.tabletBreakpoint = _kTabletBreakpoint,
this.actions,
this.firstRowIndex = 0,
this.selectedActions,
this.onRefresh,
this.mobileFetchNextRows = 100,
this.handlePrevious,
this.handleNext,
this.rowCountApproximate = false,
this.noItems,
this.mobileIsLoading,
this.mobileSlivers,
this.alwaysShowDataTable = false,
});
NativeDataTable.fromJson({
required List