Skip to content

Commit

Permalink
upgraded to v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ZainUlMustafa committed May 30, 2021
1 parent 6b3a0b4 commit 453cbba
Show file tree
Hide file tree
Showing 8 changed files with 614 additions and 60 deletions.
15 changes: 12 additions & 3 deletions CHANGELOG.md
@@ -1,3 +1,12 @@
## [0.0.1] - TODO: Add release date.

* TODO: Describe initial release.
## 0.0.1
- Plots datatables
- Styling, editable, and customization options
## 1.0.0
- Major bug fixes
- Validator now easily integrated
- Deprecated callable method
## 1.1.0
- Massive 16 different validations out-of-the-box, courtesy of FluttableVal
- FluttableValCheck is a complementing class to help customize validation rules
- Removed callable method in favour of onTableEdited, onRowAdded, and onRowDeleted
- Various issues resolved including faulty row data when a row was added
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -10,4 +10,4 @@
![fluttable logo](https://raw.githubusercontent.com/ZainUlMustafa/Fluttable/main/images/logo.png)

## Demo
![fluttable demo](https://raw.githubusercontent.com/ZainUlMustafa/Fluttable/main/images/fluttabledemo.webm)
![fluttable demo](https://raw.githubusercontent.com/ZainUlMustafa/Fluttable/main/images/fluttabledemo.gif)
43 changes: 29 additions & 14 deletions example/lib/main.dart
Expand Up @@ -29,6 +29,7 @@ class MyHomePage extends StatefulWidget {

class _MyHomePageState extends State<MyHomePage> {
final _formKey = GlobalKey<FormState>();
var tableKey = GlobalKey();
String stringEntryOne = "";

String result;
Expand All @@ -39,7 +40,7 @@ class _MyHomePageState extends State<MyHomePage> {
Points(xcorr: '', ycorr: ''),
Points(xcorr: '', ycorr: ''),
];
List<Points> listOfEnteredPoints = [];
// List<Points> listOfEnteredPoints = [];

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -81,24 +82,39 @@ class _MyHomePageState extends State<MyHomePage> {

// FLUTTABLE IMPLEMENTATION
Fluttable(
firstColumnText: "Point ",
// DOCS: takes List<List<<String>> as editableDatasetList
defaultValidator: FluttableVal.POSINT,
key: tableKey,
contentPadding: 30,
showHeaderFirstColumnText: false,
expandableList: true,
showFirstColumn: true,
firstColumnText: "Point P",
editableDatasetList:
points.convertPointsToRawList(listOfPoints),
headerTexts: ["x", "y"],
callback: (value) {
onTableEdited: (value) {
print(value);
setState(() {
listOfEnteredPoints =
points.convertRawListToPointsList(value);
listOfPoints = points.convertRawListToPointsList(value);
});
doSomething();
},
onRowAdded: (value) {
setState(() {
listOfPoints = points.convertRawListToPointsList(value);
tableKey = GlobalKey();
result = null;
});
},
onRowDeleted: (value) {
setState(() {
listOfPoints = points.convertRawListToPointsList(value);
tableKey = GlobalKey();
});
doSomething();
},
showFirstColumn: true,
expandableList: true,
validateField: validateNumericField,
formKeyIfAny: _formKey,
backgroundColor: Colors.blue[100],
otherBackgroundColor: Colors.blue[50],
minRows: 2,
),

SizedBox(height: 30),
Expand All @@ -115,11 +131,10 @@ class _MyHomePageState extends State<MyHomePage> {

doSomething() {
if (_formKey.currentState.validate()) {
print(listOfEnteredPoints.map((e) => e.toMap()));
print(listOfPoints.map((e) => e.toMap()));
print("validation cool!");
setState(() {
result =
"$stringEntryOne and ${listOfEnteredPoints.map((e) => e.toMap())}";
result = "$stringEntryOne and ${listOfPoints.map((e) => e.toMap())}";
});
} else {
print("validation not!");
Expand Down
10 changes: 5 additions & 5 deletions example/pubspec.lock
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -63,7 +63,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.1.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -106,7 +106,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -141,7 +141,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.3.0"
typed_data:
dependency: transitive
description:
Expand All @@ -157,5 +157,5 @@ packages:
source: hosted
version: "2.1.0"
sdks:
dart: ">=2.12.0-0.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.17.0"
Binary file added images/fluttabledemo.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 453cbba

Please sign in to comment.